TITLE: Lusin’s Theorem and the connection between measurable and continuous functions
QUESTION [5 upvotes]: I know questions similar to this have been asked on here, but I have yet to find an answer to my question.
I’m trying to prove Lusin’s Theorem:

Let $f$ be a measurable real-valued function on $[a,b]$. Given $\delta>0$, there exists a continuous function $\theta$ on$[a,b]$ such that $\mu(\{x;f(x)\neq\theta(x)\})<\delta$.

And in the notes that I’m reading through, the first line of the proof goes:

Let $f(x)$ be measurable on $[a,b]$ and let $\delta>0$. For each $n$, there exists a continuous function $h_n$ on $[a,b]$ such that
  \begin{equation}\mu(\{x:|h_n(x)-f(x)|\geq\delta/2^{n+2}\}<\delta/2^{n+2}.\end{equation}

How is this true? I am not seeing how we are able to make any assumptions about continuous functions just given that we have a measurable function.

REPLY [3 votes]: Let $f:[0,1]\to\mathbb{R}$ be a measurable function and $\epsilon>0$. 
First, show that there is a simple function $g:[0,1]\to\mathbb{R}$ such that
$$\{x\mid |f(x)-g(x)|>\epsilon\}$$
has measure less than $\epsilon/2$. 
Now write $g$ as $\sum_{i=1}^n \alpha_i 1_{A_i}$ with all $\alpha_i$ distinct. By inner regularity, there are disjoint closed sets $C_1,\ldots,C_n$ such that $C_i\subseteq A_i$ for all $i$ and $A_i\setminus C_i$ has measure less than $\epsilon/2n$. Let $g'=\sum_{i=1}^n \alpha_i 1_{C_i}$ and note that $$\{x\mid |f(x)-g'(x)|>\epsilon\}$$
has measure less than $\epsilon$. Moreover, the restriction of $g'$ to $C$ is continuous. Now extend $g'$ from $C$ to a continuous function $h$ on all of $[a,b]$. See here for the details. That's all.