We will show that ak=ak−1=ak−2=⋯=a0=0 by induction on n, the degree of P(x).
In fact, we may assume that the leading coefficient of P(x) is 1. For n=1,2, the result follows immediately.
Assume that the induction hypothesis is true for every n<m, we shall prove it is also true for n=m. Denote by Pm(x)=xm+⋯+a1x+a0, and for some k<m, ak=ak−1=0.
By taking derivative of Pm(x), we obtain Pm′(x)=bm−1xm−1+⋯+b1x+b0, for some real numbers bm−1,…,b0.
Since ak=ak−1=0, we conclude that bk−1=bk−2=0.
This together with Pm(x) has only real roots, implies that Pm′(x) also has only real roots.
Hence, by induction hypothesis, we get bk−3=⋯=b0=0. In other words, ak−2=⋯=a1=0. It remains to show that a0=0. Assume that a0=0, then if r1,…,rm are the roots of Pm(x), then by Vieta's theorem,
r1⋯rm=(−1)ma0,r1+r2+⋯+rm=0
and
i,j∑rirj1=0⇒i∑ri21=0
a contradiction. Therefore, a0=0, the induction process is completed.
Obviously from that, we get 0 is the root of P(x) with multiplicity at least k+1.