Let $f(x) \in \Bbb R[x]$ and $a \in \Bbb R$. Show that $(x-a)^2 \mid f(x) \iff f(a)=0$ and $f'(a)=0$.
The first implication follows from the product rule. If $(x-a)^2 \mid f(x)$, then $f(x)=(x-a)^2Q(x)$ for some $Q \in \Bbb R[x]$. Now $f(a)=0$ and $f'(x)=2(x-a)Q(x)+(x-a)^2Q'(x)$ and so $f'(a)=0+0=0$.
I don't know how to prove the converse. If I assume that $f(a)=0$ and $f'(a)=0$, then from the first equality I can derive that $(x-a)\mid f(x)$ and from the latter that $(x-a) \mid f'(x)$.
I also can derive that $f(x)=(x-a)P(x)$ for some $P \in \Bbb R[x]$ and that $f'(x)=P(x)+(x-a)P'(x)$, but I don't know how to conclude that the square of $(x-a)$ divides $f$?