Stone Weierstrass Theorem Application Prove that continuous functions on $\mathbb{R}$ with period $1$ can be uniformly approximated by trigonometric polynomials, i.e. functions in the linear span of $\{e^{−2πinx}\}_{n \in \mathbb{Z}}$. Explain why $n \in \mathbb{N}$ is not enough.
I think I need to restrict the domain into a compact set and consider the interval $[0,1]$. Since the functions are periodic with period $1$ the approximation on $[0,1]$ can be translated to any point on $\mathbb{R}$. It is easy to show that linear span of $\{e^{−2πinx}\}_{n \in \mathbb{Z}}$ is an algebra and that this algebra has the constant function. 
How do I show that this algebra is closed? 
Why is $n \in \mathbb{N}$ is not enough?

Let us restrict the domain to the interval $ [0,1] $ and use some of the theory of inner-product spaces.
One reason why having $ \mathbb{N} $ as the index set is not enough is because $ e_{1}: x \mapsto e^{2 \pi i x} $ is orthogonal to the set $ \{ e_{- n}: x \mapsto e^{- 2 \pi i n x} \}_{n \in \mathbb{N}_{0}} $. You can easily check this by computing
$$
\forall n \in \mathbb{N}_{0}: \quad
  \langle e_{1},e_{- n} \rangle
= \int_{0}^{1} \overline{{e_{1}}(x)} \cdot {e_{- n}}(x) ~ \mathrm{d}{x}
= 0.
$$
Now, for any $ N \in \mathbb{N}_{0} $ and $ c_{0},\ldots,c_{N} \in \mathbb{C} $, we have
\begin{align*}
       \| e_{1} \|_{2}^{2}
& =    \left|
       \left\langle e_{1},e_{1} - \sum_{n = 0}^{N} c_{n} e_{- n} \right\rangle
       \right| \\
& \leq \| e_{1} \|_{2} \cdot \left\| e_{1} - \sum_{n = 0}^{N} c_{n} e_{- n} \right\|_{2}
       \quad (\text{By the Cauchy-Schwarz Inequality.}) \\
& \leq \| e_{1} \|_{2} \cdot
       \left\| e_{1} - \sum_{n = 0}^{N} c_{n} e_{- n} \right\|_{\infty}.
\end{align*}
Hence, as $ \| e_{1} \|_{2} \neq 0 $, we obtain
$$
\| e_{1} \|_{2} \leq \left\| e_{1} - \sum_{n = 0}^{N} c_{n} e_{- n} \right\|_{\infty}.
$$
If we could approximate $ e_{1} $ uniformly by the linear span of $ \{ e_{- n} \}_{n \in \mathbb{N}_{0}} $, then the right-hand side of the inequality above could be made arbitrarily small, while the left-hand side remains as a non-zero constant. This is a contradiction.
