Solution (source code)

= Solution

Define the reflected <polynomial> $\widetilde p(x)=-p(-x)$. It belongs to $\Pi_n$. Since $u$ is odd, a change of variable and the evenness of the weight give
$$
\|u-\widetilde p\|^2
=\int_{-1}^1x^2(u(x)+p(-x))^2\,dx
=\int_{-1}^1x^2(u(x)-p(x))^2\,dx.
$$
Thus $\widetilde p$ is another <polynomial least-squares approximation>. By uniqueness, $\widetilde p=p$, so
$$
\boxed{p(-x)=-p(x).}
$$
The conclusion includes the zero <polynomial>, which is both odd and even.