$(x-a)^k|f'(x)$ implies $(x-a)|f(x)$ when all complex roots of polynomial $f(x)$ are real and where $k \geq 2$ suppose all complex roots of polynomial $f(x)$ are real. then $$(x-a)^k|f'(x)\Rightarrow (x-a)|f(x)$$where $k\geq2$
 A: We need to assume that $f(x)$ has degree $\ge 1$. For in a trivial sense the polynomial $17$ is a counterexample to the assertion. 
Let $f(x)$ have degree $n \ge 1$, and let the distinct real roots of $f(x)$, say in increasing order, be $a_1,a_2,\dots, a_k$, with multiplicities $e_1,e_2, \dots,e_k$ respectively. 
If all the roots of $f(x)$ are real, then $\sum_{i=1}^k e_i=n$.
By Rolle's Theorem, there is a root of $f'(x)$ strictly between any two distinct roots of $f(x)$. That accounts for $k-1$ roots of $f'(x)$. 
It is a standard result about polynomials that $f'(x)$ has a root of multiplicity at least $e_i-1$ at every $a_i$. That accounts for $\sum_{i=1}^{k} (e_i-1)$ roots of $f'(x)$.
Add up. We have accounted for $(n-k)+(k-1)=n-1$ roots of $f'(x)$. There cannot be any more, since $f'(x)$ has degree $n-1$. (Here we have used the assumption that $f(x)$ is non-constant.) In particular, no root of $f'(x)$ that is between consecutive $a_i$ can have multiplicity greater than $1$. 
Thus if $f(a)\ne 0$, we cannot have a root of $f'(x)$ of multiplicity greater than $1$ at $x=a$. This completes the proof of the assertion. 
Added: As has been pointed out by alex.jordan in a question/comment, under the conditions of the problem we can conclude that $(x-a)^{k+1}$ divides $f(x)$. 
