I'm dealing with this problem that says that if $f(x)$ with real coefficients is non-negative for every $x \in \mathbb{R}$ then there exists the polynomials $f_1(x)$ and $f_2(x)$ from $\mathbb{R}[x]$ such that $f(x)$ can be written in the form of $f(x)=f_1^2(x) +f_2^2(x)$
The solution in my book says that all its real zeros have even multiplicity. Can someone tell me why is that?
Suppose that we have a root of $f(x)$ at $x = \alpha$. So we have $f(x) = (x-\alpha)^k Q(x)$, where $Q$ does not have a root at $\alpha$, and we must show that $k$ is even. Since $Q$ does not have a root at $\alpha$, its value at $\alpha$ is nonzero. But if $k$ is odd, the sign of $(x-\alpha)^k$ is different on either side of $\alpha$, and so the sign of $(x-\alpha)^k Q(x)$ is also different on either side of $\alpha$, implying that $f$ is not always positive. This is a contradiction, and so we conclude that $k$ is even.