Problem: If $f$ is a bounded and measurable function on $[0,1]$, show that there exists a sequence of continuous functions $f_n(x)$ on $[0,1]$ s.t. $\int\left|f_n(x)-f(x)\right|dx\to 0$ as $n\to\infty$.
I asked a similar question to this before, but did not get a good answer. Here is my proof for this problem, which is equivalent to show that $C([0,1])$ is dense in $L^1([0,1])$.
First, denote $\mathcal{S}$ to be the space of simple functions $s(x)$ on $[0,1]$ with measure $\mu\left(\{x: s(x)\neq 0\}\right)<\infty$. Need to show that $\mathcal{S}$ is dense in $L^1([0,1])$, i.e. for every $\varepsilon>0$, as $n\to\infty$, $$\int_{[0,1]}|f-s_n|\to 0$$ Obviously, $\mathcal{S}\subset L^1\left([0,1]\right)$, since $$\int_{[0,1]}s(x)d\mu\leq\sup_{x}s(x)\mu\{x: f(x)\neq 0\}<\infty$$ By simple approximation theorem, there exists simple $\{s_n\}\uparrow f$ such that $\{s_n\}\to f$ for measurable $f$. By monotonicity, $$\int_{[0,1]}s_n\leq\int_{[0,1]}f<\infty$$ Hence $s_n\in L^1$, which implies $s_n\in\mathcal{S}$. Since $|f-s_n|\leq|f|\in L^1$, by dominated convergence theorem, $$\lim_{n\to\infty}\int_{[0,1]}|f-s_n|=\int_{[0,1]}\lim_{n\to\infty}|f-s_n|\to 0$$
Second, need to show that $C([0,1])$ is dense in $\mathcal{S}$. Let $s\in\mathcal{S}$. By Lusin's theorem, there exists $\{f_n\}\in C([0,1])$ s.t. $\mu\left(\{x:f_n(x)\neq s(x)\}\right)<\varepsilon$, and $|f_n|\leq\|s\|_\infty$. Hence
$$\int_{[0,1]}|f_n(x)-s(x)|=\int_{\{f_n(x)\neq s(x), x\in[0,1]\}}|f_n(x)-s(x)|+\int_{\{f_n(x)=s(x), x\in[0,1]\}}|f_n(x)-s(x)|=\int_{\{f_n(x)\neq s(x), x\in[0,1]\}}|f_n(x)-s(x)|\leq\int_{\{f_n(x)\neq s(x), x\in[0,1]\}}2\|s\|_\infty\leq 2\|s\|_\infty\varepsilon$$
Hence
$$\int_{[0,1]}|f_n(x)-f(x)|\leq\int_{[0,1]}|f_n(x)-s(x)|+\int_{[0,1]}|s(x)-f(x)|\leq\left(2\|s\|_\infty+1\right)\varepsilon$$ Let $\varepsilon\to 0$, we get the desired result. Hence $C([0,1])$ is dense in $L^1([0,1])$.
My questions:
Can anyone help me check whether my proof is valid? If not, how to improve that?
I'm thinking of new ways to proof this, without using the density property listed in many real analysis texts. I'm thinking of using Littlewood's principle/Lusin's theorem (different from my current approach), but have not come up with a matured argument.
Here are some other posts related to this problem, but not exactly the same, since I'm dealing with sequence of continuous functions in my case.
Continuous functions on $[0,1]$ is dense in $L^p[0,1]$ for $1\leq p< \infty$
Questions about Proof of Lusin's Theorem
Is every Lebesgue measurable function on $\mathbb{R}$ the pointwise limit of continuous functions? (The selected answer from this post inspires me. Some comments under the answer are some new approaches, but not written down in details. I'd be happy if someone can use these approaches to proof my case.)
I'll be grateful if anyone can help me with the questions I listed above. Thank you.