First consider just the requirement for a polynomial to have the two given points on the $x$\- axis. We can use $(x-2)(x-10)$.
Now consider just the extra requirement for a polynomial to have a point of zero gradient at $x=5$. Try $(x-c)(x-2)(x-10)$. Differentiate and put $x=5$ and you will find that $c$ must be $\frac{25}{2}.$
We require the point of zero gradient to be at $(5,-5)$. Substitute $x=5$ in $a(x-\frac{25}{2})(x-2)(x-10)$ and you will get the solution $g(x)=\frac{1}{45}(25-2x)(x-2)(x-10)$.
Then the quartic $f(x)-g(x)$ has roots at $2,5,10$ with the root at $5$ being repeated and so is a multiple of $(x-2)(x-5)^2(x-10)$. Then $$45f(x)=(A(x-5)^2+25-2x)(x-2)(x-10)).$$
All that remains for you to do is to (if possible) choose the values of the constant $A$ so that $f(x)$ has no "other" roots and no "other" points with zero gradient.