About example of continuous function on $\mathbb{R}$ which cannot be uniformly approximated by polynomials? 
Possible Duplicate:
Weierstrass approximation does not hold on the entire Real Line 

If a function $f: \mathbb{R}\rightarrow \mathbb{R}$ is continuous then $f$
can be uniformly approximated  by smooth functions (see here). By the Weierstrass approximation theorem $f$ can be uniformly approximated by polynomials on each compact subinterval of $\mathbb{R}$.
What is example of continuous function $f: \mathbb{R}\rightarrow \mathbb{R}$ which cannot be uniformly approximated by polynomials on the whole $\mathbb{R}$?
Thanks
 A: This was the subject of a previous question.  The result is:

If $f$ can be approximated uniformly on $\mathbb{R}$ by a sequence of polynomials $p_n$, then $f$ is a polynomial.  Moreover, for sufficiently large $n$, we have $p_n = f + c_n$ where $c_n$ is a sequence of real numbers with $c_n \to 0$ (so the convergence is not really very interesting).

Thus any function which is not a polynomial will do as a counterexample for you.
The proof is essentially a consequence of the fact that the only bounded polynomials are constant.  Suppose $p_n \to f$ uniformly.  Since $\{p_n\}$ is uniformly Cauchy, there exists an $M$ so large that for any $n \ge M$, we have $\sup_{x \in \mathbb{R}} |p_n(x) - p_M(x)| \le 1$.  So for all such $n$, $p_n - p_M$ is a bounded polynomial, hence is some constant $a_n$, and we have $p_n = p_M + a_n$.  Since $\{p_n\}$ converges uniformly, we must have $a_n$ converging to some $a$.  So $f = \lim_{n \to \infty} p_n = p_M + a$ which is a polynomial, and we have $p_n = f + (a_n - a)$ for all $n \ge M$.
A: Any bounded non-constant function should do. Since polynomials explode at infinity, the uniform distance of any bounded function and any polynomial will be infinite.
