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?

The fundamental tenet of Stone-Weierstrass is an algebra of functions $\mathcal{A}$ on $X$ that is closed under complex conjugation, separate points and for every point $x\in X$ there is an $f\in\mathcal{A}$ such that $f(x)\neq 0$.
Your algebra satisfies the first property since $e^{-2\pi inx} = \overline{e^{2\pi inx}}$ so it is closed under conjugation.
Your algebra of trigonometric polynomials satisfies the latter property since for any rational $q$ which we write in lowest terms: $q = \frac{m}{n}$, then if we consider $f(x) = e^{2\pi inx}$, $f(q) = 1$. Since every irrational $x$ can be made close to a rational and the complex exponentials are continuous, we can find $f$ such that $|f(x)|>0$ (by a modest adaptation of the above reasoning). (You could pick $f$ to be a constant function if you were so inclined.)

We need only then to see that it separates points.
Suppose $x\neq y\in[0,1)$. We wish to find $f$ such that $f(x)\neq f(y)$. We will deal with the case that $x=0$ and $y=1$ after. If $x$ and $y$ are rational, write $x = \frac{m}{n}$ and $y=\frac{m'}{n'}$. Without loss of generality, assume $n < n'$. If $n$ does not divide $n'$, consider $f(z) = e^{-2\pi in'z}$; $f(y) = 1$ but $f(x)\neq 1$. If $n$ does divide $n'$, consider $f(z) = e^{-2\pi i(n'+1)z}$. Then $f(y) = e^{-2\pi i\frac{m'}{n'}}$ and $f(x) = e^{-2\pi i\frac{m}{n}}$. These are only equal if $\frac{m'}{n'} = \frac{m}{n}+2k\pi$. However since $y,x\in[0,1]$ and $x\neq y$, this can't happen so $f(x)\neq f(y)$.
If they are irrational, find rationals that are close to them and repeat the same kind of analysis as above.
Suppose that $x=0$ and $y=1$. At these points, every function in your algebra is equivalent. However this is, in fact, not a problem. The reason is that these points are basically equivalent with respect to your functions. Every periodic function (with period $1$) is equal at $0$ and $1$ so you really only needed to focus on $[0,1)$ anyway.
