We know that if $f$ is cont. on $[a,b]$, then there exists a sequence of polynomials $(P_n)$ such that $P_n\to f$ uniformly.(*)
Now the question is that if $f$ is cont. on $\mathbb{R}$, how can we show that there exist a sequence of polynomials such that $P_n\to f$ uniformly on each bounded subset of $\mathbb{R}$? Can we say that since $f$ is cont. on $\mathbb{R}$, it is cont. on any interval, then use (*)? Any help would be appreciated. Thank you
Consider a sequence of expanding segments $[a_n,b_n]=[-n,n]$, and a sequence of decreasing $\varepsilon_n=1/n$. Since $f$ is continuous on $[a_n,b_n]\subset\mathbb R$ then there exists a polynomial $P_n$ for which $\max_{x\in[a_n,b_n]}|P_n(x)-f(x)|<\varepsilon_n$. Then the sequence $\{P_n\}$ converges to $f$ uniformly on any bounded set in $\mathbb R$.
Let A be a bounded set in $\mathbb R$. For any $\varepsilon>0$ there exists $N\in\mathbb N$ such that $[a_n,b_n]\supset A$ and $\varepsilon_n<\varepsilon$ for all $n>N$. And by construction of $P_n$ we have $\max_{x\in A}|P_n(x)-f(x)|\le\max_{x\in[a_n,b_n]}|P_n(x)-f(x)|<\varepsilon_n<\varepsilon$, which means uniform convergence.