Stone-Weierstrass theorem and Polynomials in multidimensional real space Stone-Weierstrass theorem on closed interval $[a, b]$ (in $\mathbb{R}$) states that any continuous function $f$ on $[a, b]$ can be approximated by polynomial function $p$, arbitrarily close to $f$.
From the above observation, I wonder if this can directly be applied to multidimensional case: is it true that any continuous function $f:X \rightarrow \mathbb{R}^m$, where $X \subset \mathbb{R}^n$ is compact, can be approximated by polynomial function $p$, i.e.,
$$\forall x\in X, \|f(x) - p(x)\|< \epsilon ?$$
If so, please show me a detailed example (qualitatively).

Wikipedia quotes the Stone-Weierstrass theorem as

Stone–Weierstrass Theorem (real numbers). Suppose $X$ is a compact Hausdorff space and $A$ is a subalgebra of $C(X, \Bbb R)$ which contains a non-zero constant function. Then $A$ is dense in $C(X, \Bbb R)$ if and only if it separates points.

Which is to say, the only actual property of the closed interval $[a,b]$ that is necessary for the theorem is that it is compact and Hausdorff.
And the only necessary properties of the algebra of polynomial functions on this compact Hausdorff is that it is a subalgebra of the continuous real-valued functions (i.e. you can add and multiply polynomials together and scale them by real numbers, and still always end up with polynomials), that it contains some non-zero constant function, and that it can separate points (i.e. for any two points, there is at least one polynomial that evaluates to different values at the two points).
This immediately applies to polynomial functions in more than one variable, just as well as it does polynomial functions in a single variable, in addition to a whole host of other classes of functions (like sines of different frequencies for Fourier series).
