Let $f:[a,b] \to \mathbb{C}$ is Lebesgue measurable. Then for $\epsilon \gt 0$, show that there is a compact set $E$ such that $\mu(E^c) \lt \epsilon$ and $f|_{E}$ is continuous .
This is a problem from Folland (Page-64, Q44). It is known as Lusin's Theorem. I am sure there are questions related to this in the site but I wanted to see if my try is correct or not.
For each $n \in \mathbb{N}$, there is a continuous function $g_n$ which vanishes outside a bounded set such that $$\int_{[a,b]} |f-g_n| \lt \dfrac{1}{n}$$ Letting $n \to \infty$ we have $g_n \to f$ in $L^1$. Then there is a sub-sequence $g_{n_{k}}$ such that $g_{n_k} \to f, \mu-$a.e. By Egoroff's theorem there is a $F \subset [a,b]$ such that $\mu(F) \lt \dfrac{\epsilon}{2}$ and $g_{n_k} \to f$ uniformly in $F^c$. Now there is an open set $U$ such that $\mu(U) \lt \mu(F)+\dfrac{\epsilon}{2}$ with $F \subset U$. Hence $U^{c} \subset F^{c}$ and $U^c$ is compact (being a closed subset of $[a,b]$). Moreover $g_{n_k} \to f$ uniformly on $U^c$. Being a uniform limit of continuous functions, $f$ is continuous on $U^c$. And $\mu(U) \lt \mu(F)+\dfrac{\epsilon}{2} \lt \epsilon.$
This seems alright to me. Is this correct? In measure theory, certain results which seem not to be true, turn out to be true.
Thanks for the help!!