polynomials in $t^2$ is dense in $C([a, b])$ if $0 \notin [a,b]$ My instructor mentioned as an application of stone-weistrass that the set of polynomials in $t^2$ is dense in $C([a, b])$ if $0 \notin [a,b]$. I could not be able to prove the density to understand the application. 
Stone-Weistrass Theorem :  Let $E$ be a compact metric space. If $A$ is a subalgebra of $C(E)$ that separates points and contains the constant
functions, then $\bar{A} = C(E)$.
Let $A = \{p(t^2) \in C(E) \}$ , then this set clearly contains constant functions. But not sure how to show that the functions in $A$  separate points in $E$ and how $0 \notin [a,b]$ is derived.
 A: $0 \notin [a,b]$ implies that either $[a,b] \subseteq [0,\infty)$ or $[a,b] \subseteq (-\infty,0]$. In either case $p(t)=t^{2}$ separates any two distinct points $x$ and $y$ since $x$ and $y$ have the same sign. 
A: Hint: let $x, y$ be real numbers and define $p(t) = t^2 - x^2$. If $x \neq y$, can we have $p(x) = p(y)$? What if $x$ and $y$ are both positive? Or both negative?
A: The function $t^2$ separates points in any interval $[a, b]$ with
$0 \notin [a, b], \tag 1$
for then if
$t_1^2 = t_2^2, \; t_1, t_2 \in [a, b], \tag 2$
we have
$t_1^2 - t_2^2 = 0, \tag 3$
and hence
$(t_1 + t_2)(t_1 - t_2) = 0; \tag 4$
now (1) implies either
$0 < a \le b, \tag 5$
or
$a \le b < 0; \tag 6$
in either case 
$t_1, t_2 \in [a, b] \Longrightarrow t_1 + t_2 \ne 0, \tag 7$
thus from (4),
$t_1 - t_2 = 0 \Longrightarrow t_1 = t_2; \tag 8$
which in turn implies that distinct $t_1$, $t_2$ map to distinct $t_1^2$, $t_2^2$, and thus that $t^2$ separates points on any $[a, b]$ satisfying (1).
It is now evident that the set of polynomials in $t^2$ also separates points on such $[a, b]$, since $t^2$ is in this set.
With regards to the condition (1), we have seen above that it is sufficient for $t^2$ to separate points, but it is not in fact necessary, as may be see by considering intervals of the form $[a, 0]$, $a < 0$ or $[0, b]$, $b > 0$; $t^2$ clearly separates points on such intervals even though they contain $0$.
Finally, it is clear that $t^2$ cannot separate points in any interval $[a, b]$ with
$0 \in (a, b), \tag 9$
since then 
$a < 0 < b, \tag{10}$
and so with
$0 < c < \min(-a, b), \tag{11}$
$(-c)^2 = c^2, \tag{12}$
and $t^2$ does not separate points on $[a, b]$; and neither, then, do any of the polynomials $p(t^2)$, since
$p((-c)^2) = p(c^2). \tag{13}$
A: $0 \in [a,b]$ means that $[a,b] \subseteq \langle 0,+\infty\rangle$ or $[a,b] \subseteq \langle -\infty,0\rangle$.
Assume that $[a,b] \subseteq \langle 0,+\infty\rangle$ and let $f \in C([a,b])$ be arbitrary. Stone-Weierstrass theorem implies that there exists a sequence of polynomials $(p_n)_n$ such that $$p_n(t) \to f(\sqrt{t})$$
uniformly on $[a^2,b^2]$.
Then it is easy to see that
$$p_n(t^2) \to f(t)$$
uniformly on $[a,b]$. Hence $\{p(t^2) : p \text{ is a polynomial on }[a,b]\}$ is dense in $C([a,b])$.
Similarly, if $[a,b] \subseteq \langle -\infty,0\rangle$ then approximate the function $f(\sqrt{-t})$ by polynomials on $[b^2, a^2]$.
