The following is a proof to show that $L^2(\mathbb{R})$ is separable, but I am unsure of how exactly to finish the last step. I shall breeze through the rest.
1) Define $H_n = \{ (h : \mathbb{R} \to \mathbb{R} ) : \text{support}(h) \subset [n,n+1]\}, \displaystyle\int_\mathbb{R} h^2 < \infty$.Show that $H_n$ has a dense countable subset.
The above is easy, by considering the density of continuous functions (of a certain kind) in $H_n$ and the density of polynomials in the continuous functions.
2) Show that $L^2(\mathbb{R})$ is separable by using the fact that $H_n$ is separable for all $n$.
I do not know how to approach this problem. Let $f$ be any function in $L^2(\mathbb{R})$. Then we can write $f =\displaystyle\sum_{n=-\infty}^{\infty} f_n$, where $f_n$ is the restriction of $f$ on $[n,n+1]$ and zero everywhere else (the doubly infinite sum converges in $L^2$ norm). We can approximate each of the $f_n$ by polynomials, but the infinite sum of polynomials need not be a polynomial, so I am stuck.
For $k\in\mathbb{N}$ consider the function $$s_k=\sum_{n=-k}^{k}f_n.$$ Then $$|f-s_k|\le |f|$$ and so, since $f^2$ is integrable, you can apply the Lebesgue dominated connvergence theorem to conclude that $$\lim_{k\to\infty}\int_{\mathbb{R}}|f-s_k|^2dx=0.$$ Thus for $\varepsilon>0$ you have $$\int_{\mathbb{R}}|f-s_k|^2 dx\le \varepsilon$$ for all $k$ large. You can now approximate $s_k$ with polynomials.