We are presented with a third order polynomial with 4 terms, so we expect 3 solutions for f(x)=0. To prove that (x-2) is a factor we must insert the value of x=2 into the function and if f(2)=0 then we have verified that (x-2) is a factor. We can now perform long division using the property of polynomials (which states that a polynomial is divisible by it's factors) to simplify f(x) by dividing through by (x-2).
This results in (2x^2 - 3x - 2), which can be simplied further via factorisation to produce (x-2)(2x+1). We have now fully factorised f(x) and can see that we have a repeated root at x=2 so even though f(x)=(x-2)(x-2)(2x+1) is a correct answer it is better practice to write the final answer as f(x)=(x-2)^2 (2x+1) so that the repeated root can be seen clearly.
To double check that (2x+1) is a factor we can insert the value of x=-1/2 such that f(-1/2)=0.