<s>[INST] 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$.
 [/INST] 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}$.
</s>