Prove that a real polynomial $f(x)\geqslant 0, \forall x$ if and only if there exists two real polynomials $g(x), h(x)$ such that $f(x)=g^2(x)+h^2(x)$?
The sufficiency is trivial.
But my question is how to deal with the necessity.
Here is another problem that I've solved.
Suppose that real polynomial $f(x)=a_nx^n+\cdots+a_1x+a_0$ with $a_n\neq 0$ has no real root, then there exists two real polynomials $g(x)$ and $h(x)$ such that $f(x)=g^2(x)+h^2(x)$.
Hint: Factor out the real roots of $f$ to reduce to the case you've already solved.
A full solution is hidden below.