TITLE: Show that there is a continuous $g$ with compact support
QUESTION [5 upvotes]: If $f$ is a measurable complex function (that means that it doesn't take the values $\pm \infty$) with compact support, then for each $\epsilon >0$ there is a continuous $g$ with compact support so that $m(\{f\neq g\})<\epsilon$.
Could you give me some hints how I could show that?? 
EDIT: 
Do we have to prove it as followed?? 
If $f$ is measurable and finite in $\mathbb{R}^d$ then for each $\epsilon>0$ there is a closed $E$ with $m(\mathbb{R}^d \setminus E)<\epsilon$ so that $f|_E$ is continuous.
It is enough to show this in the case in which $f$ is defined in an open bounded cube $Q$ and it is bounded. 
Then it is integrable, so there is a sequence of continuous functions $g_n$ so that $||g_n-f||_1 \rightarrow 0$, so there is a subsequence $g_{k_n}$ with $g_{k_n} \rightarrow f$ almost everywhere, so from Egorov theorem, there is $A$ with $m(Q\setminus A)<\epsilon /2$ so that $g_{k_n} \rightarrow f$ uniformly in $A$. 
The desired $E$ is a closed subset of $A$ with $m(A\setminus E)<\epsilon /2$.

REPLY [5 votes]: This is called Lusin's theorem. The proof can be established by invoking Egoroff's theorem which says that almost sure convergence can be made uniform almost everywhere. 
Idea: approximate your $f$ by step functions. Each step function is bounded and can be approximated by a continuous function. Uniform limits of continuous functions is continuous.