The algebra generated by the set $\{1,x^2\}$ is dense in $C\left[0,1\right]$ with the supremum norm but fails to be dense in $C\left[-1,1\right]$. Show that the algebra generated by the set $\{1,x^2\}$ is dense in $C\left[0,1\right]$ with the supremum norm but fails to be dense in $C\left[-1,1\right]$.
I have know that for each $f\in$$C\left[0,1\right]$ and $\epsilon>0$, there is a polynomial $p$ such that $||f-p||_\infty<\epsilon$.
 A: To show that the algebra generated by $\{1,x^2\}$ is not dense in $C[-1,1]$ consider $x\in C[-1,1]$.  Let $f$ be in the algebra, since $1$ and $x^2$ are both even functions, $f$ is also an even function.
Consider the cases where $x=\frac{1}{2}$ and $x=-\frac{1}{2}$.  At these points, $f(-\frac{1}{2})=f(\frac{1}{2})$.  Moreover, consider 
$$
\left|f\left(\frac{1}{2}\right)-\frac{1}{2}\right|\qquad \left|f\left(-\frac{1}{2}\right)-\left(-\frac{1}{2}\right)\right|=\left|f\left(\frac{1}{2}\right)+\frac{1}{2}\right|.
$$
Observe, by the triangle inequality:
$$
1=\left|\frac{1}{2}-\left(-\frac{1}{2}\right)\right|=\left|\frac{1}{2}-f\left(\frac{1}{2}\right)-\left(-\frac{1}{2}\right)+f\left(\frac{1}{2}\right)\right|\leq\left|f\left(\frac{1}{2}\right)-\frac{1}{2}\right|+\left|f\left(\frac{1}{2}\right)+\frac{1}{2}\right|=\left|f\left(\frac{1}{2}\right)-\frac{1}{2}\right|+\left|f\left(-\frac{1}{2}\right)-\left(-\frac{1}{2}\right)\right|.
$$
At least one of thee two differences must be at least $\frac{1}{2}$, so the $\infty$ norm cannot be less than $\frac{1}{2}$.
A: The algebra $A$ generated by the set $\{1,x^2\}$ is the set of all linear combinations of products of $1$ and $x^2$. Because those functions are even (ie. $f(t)=f(-t)$), all functions in $A$ are even. So they cannot approximate an odd function like $x$. Otherwise there would be an $f\in A$ with $\|f-x\|_\infty < 1$, but
then $|f(1)-1|<1$ and $|f(-1)-(-1)|<1$ implie $f(1)>0$ and $f(-1)<0$, which contradicts $f(1)=f(-1)$.
See also the Stone-Weierstrass theorem for a more general critereon when such an algebra is dense.
