Schwartz class dense in $L^2$, reference Does anyone know a good reference where it is shown that the Schwartz class $\mathcal{S}(\mathbb R)$ is a dense subset of $L^2(\mathbb R)$?
Many thanks
 A: The most frequent/easiest way I've seen this proved is to show instead that $C_c^\infty(\mathbb R)$ is dense $L^2(\mathbb R)$ and then just note $C_c^\infty(\mathbb R) \subset S(\mathbb R)$. This can be found in anything from big Rudin to Folland's Real Analysis to Trèves's Topological Vector Spaces, Distributions, and Kernels.
The last reference, along with similar classic texts on locally convex spaces (or really any books emphasizing the role of locally convexity in approximation), would be my (very biased) suggestion if you're at a level where you feel comfortable reading from them.
Edit: According to Silvia's comment, it might not appear in big Rudin (although I'd be surprised not to see it there). Proposition 8.17 in Folland states that $C_c^\infty$ (and therefore $S$) is dense in $L^p$ for $1 \leq p \leq \infty$.
A: Dan gave a good bunch of references. Another proof can be found in Lieb and Loss' "Analysis", Lemma 2.19. The following is a quick sketch of how the proof goes.

In Rudin's "Real and Complex Analysis", Theorem 3.14, it is proved that $C_c(\mathbb R)$ is dense in $L^p (\mathbb R)$ (you can find this also in Folland, Proposition 7.9).
We know that $C_c^{\infty}(\mathbb R) \subset \mathcal{S}(\mathbb R)$, so to show density it is enough to show $C_c^{\infty}(\mathbb R)$ is dense in $L^2(\mathbb R)$. To this purpose it is enough to show that $C_c^{\infty}(\mathbb R)$ is dense in $C_c(\mathbb R)$ since we already know that the latter is dense in $L^2(\mathbb R)$.
Now, let $\rho_{\frac1n}$ be a family of mollifiers. Then, if $f \in C_c(\mathbb R)$, we have $f_n=\rho_{\frac1n} * f \in C_c^{\infty}(\mathbb R)$ and $f_n \to f$ in $L^p(\mathbb R)$, for $p \in [1,+\infty)$ (see, for instance Theorem 2.1 in Duoandikoetxea's "Fourier Analysis", or section 8.2 in Folland) and this gives us the desired result.
A: A proof that $C_{0}$ is dense in $L^{p}$ can be found in Naylor and Sell's "Linear Operator Theory in Engineering and Science", Appendix D, paragraph 12 "Dense Subspaces in $L^{p}$, $1\le p<\infty$".
Another proof is in Brezis' "Functional analysis, Sobolev spaces and partial differential equations", Theorem 4.12.
