The standard statement of the Stone-Weierstrass theorem is:
Let $X$ be compact Hausdorff topological space, and $\mathcal{A}$ a subalgebra of the continuous functions from $X$ to $\mathbb{R}$ which separates points. Then $\mathcal{A}$ is dense in $C(X, \mathbb{R})$ in sup-norm.
Most materials that I can find on the extension of Stone-Weierstrass theorem discuss only the multivariate case, i.e., $X\in \mathbb{R}^d$. I wonder whether this theorem can be extended to vector-valued continuous functions. Specifically, let $\mathcal{A}$ be a subalgebra of continuous functions $X\to \mathbb{R}^n$, with the multiplication defined componentwisely, i.e., $\forall f, g\in \mathcal{A}$, $fg = (f_1g_1, \ldots, f_ng_n)$. Then shall we claim $\mathcal{A}$ is dense in $C(X, \mathbb{R}^n)$ in sup-norm if $\mathcal{A}$ separates points?
Any direct answer or reference would greatly help me!
Edit: As Nik Weaver points out, the original conjecture is false since the functions of the form $x\mapsto (f(x), 0, \ldots, 0)$ create a counter-example. I wonder whether there are non-trivial Weierstrass-type theorems on vector-valued functions. For instance, what if we further assume $\mathcal{A}$ is dense on each `axis'?