The question asked in (ISI-JRF) exam was:
Let $f$ be a real valued continuous function on $[-1,1]$ such that $f(x)=f(-x)\forall x\in[-1,1]$. Show that $\forall\epsilon\gt0,\ \exists$ a polynomial $p(x)$ with rational coeficients such that $\forall x\in[-1,1]$,$$|f(x)-p(x^2)|\le\epsilon$$.
My proof ran as follows:
By the Weierstraß aproximation theorem, we have that every real valued uniformly continuous function can be approximated by a polynomial with real coefficients, i.e. $\forall\epsilon\gt0,\forall x\in[-1,1],\exists q(x)$(polynomial) such that $$|f(x)-q(x)|\lt\epsilon\cdots(1)$$. Also, by the evenness of the given function, we have:-$$|f(-x)-q(-x)|<\epsilon\implies|f(x)-q(-x)|<\epsilon\cdots(2)$$. Now, adding $(1)+(2)$:- $$|f(x)-q(x)|+|f(x)-q(-x)|<2\epsilon$$. Hence, by triangle inequality, $$|q(x)-q(-x)|\lt2\epsilon$$, i.e., the polynomial is also even. Hence, $\exists$ a polynomial $p(x)$ such that $p(x^2)=q(x)$. Now, since rational numbers are dense in real numbers, therefore, we obtain the desired result.
I think the above proof is correct. If the proof is incorrect, please provide hints regarding right proof. Thanks beforehand.
You have that, as angryavian commented, $q$ is almost even.
For any function $f$, $g(x) =\frac12(f(x)+f(-x)) $ is exactly even.
So, consider $r(x) =\frac12(q(x)+q(-x)) $. Then $r(x)$ is exactly even and $|r(x)-q(x)| =|\frac12(q(x)-q(-x))| $ is also small, so $|r(x)-f(x)|$ is also small.
Now use $r(x)$ as a polynomial with only terms with even exponents.