We know that the roots of the polynomial is 2 and -7. Since the original function is x-k (in which k is the roots) you would put (x-2) and (x+7).
Note: When you solve for 0 for (x-2) and (x+7), it would become 2 and -7
So, it would look like (x-2)(x+7).
You would then multiply it out (use the FOIL method.) That is how you would find f(x)=x^2+5-7