In V. Moretti's "Spectral Theory and Quantum Mechanics," example 3.32 (1), he attempts to show that the functions

$$f\_n(x)=\frac{1}{\sqrt{L}}e^{i\frac{2\pi n}{L}x},$$

where $n\in\mathbb Z,x\in[-L/2,L/2]$ for fixed $L>0$, generate a dense subspace of $L^2[-L/2,L/2]$. But I think his argument is wrong, as confirmed by [this post](https://math.stackexchange.com/questions/2458944/stone-weirstrass-clarification) and discussed by me below. **My question is, how can we most easily correct this proof, preferably without resorting to an entirely different method?**

Let $S=\operatorname{span}\{f\_n\}\_{n\in\mathbb N}$. Moretti's approach is to show that $S$ is dense in $C[-L/2,L/2]$ (the continuous functions from $[-L/2,L/2]$ to $\mathbb C$), and then that $C[-L/2,L/2]$ is dense in $L^2[-L/2,L/2]$. But to show that $S$ is dense in $C[-L/2,L/2]$, he invokes the Stone-Weierstrass theorem, which requires that $S$ separates points in $[-L/2,L/2].$ From what I can tell (and as is similarly claimed in the above-linked post), $S$ does not separate the endpoints $-L/2$ and $L/2$. Can this approach still be salvaged, and if so, how?