Dense subspace of $L^{2}[0,1]$ I know that $C[0,1]$ is dense in $L^{2}[0,1]$ but is $\{f\in C^{2}[0,1]:f(0)=f(1)=0\}$ dense in $L^{2}[0,1]$?
 A: Yes. You should follow Steven Gubkin's advice and draw a picture. After you've done that, you'll understand the intuition behind the following outline of the proof:


*

*The continuous function on $[0,1]$ can be approximated uniformly by $C^2$ functions by the Weierstrass Theorem. 

*So for $f \in L^2[0,1]$ you can find $f_1 \in C([0,1])$ such that $\|f - f_1\|_2 \le \epsilon/2$. You can also find $f_2$ such that $\|f_2 - f_1\|_2 \le \|f_2 - f_2\|_\infty \le \epsilon/2$. Hence $\|f - f_2\|_2 \le \epsilon$ and you can approximate arbitrarily well with $C^2$ functions.

*If $f$ is continuous, then it is bounded, and for every $\epsilon > 0$ there exists $\delta > 0$ such that
$$ \left| \int_0^1 \! f^2 \, dx - \int_{\delta}^{1-\delta} \! f^2 \, dx \right|$$
$$\le \int_0^\delta \! f^2 \, dx + \int_{1-\delta}^1 \! f^2 \, dx \le 2\delta\|f\|_\infty^2 \le \epsilon $$

*Now take $f_2$ from the second bullet point, and modify it on $[0,\delta] \cup [1-\delta, 1]$ so that $f_2$ stay $C^2$ and $f(0) = f(1) = 0$. 

*Combine this with the third bullet point and you're done.

