A consequence of Lusin's theorem The Lusin's Theorem states that suppose $f$ is a measurable function on a measurable set $E$. Then for each $\epsilon$>$0$, there isa continuous function $g$ on $\mathbb{R}$ and a closed set $F$ contained in $E$ such that $f=g$ on $F$ and $m(E-F)$

My question is how to deduce the following consequence from Lusin's theorem: Suppose $f$ is integrable on $\mathbb{R}$. Then there is a continuous function $g$ satisfying $g(x)=0$ for any $x$ not contained in some interval such that $\int_{\mathbb{R}}|f-g|$<$\epsilon$.
I can see it works for a closed set $F$. But how does it work for some interval?
 A: Since $f$ is integrable, there exists a bounded function $h$ with $|h|\leq|f|$ and $\int|f-h|<\varepsilon/3$.  There is also $k>0$ such that $\int_{\mathbb R\setminus[-k,k]}|h|<\varepsilon/3$.
By Lusin, there exists a closed set $F\subset[-k-1,k+1]$ and a continuous function $g'$ such that $m([-k-1,k+1]\setminus F)<\varepsilon/[6(\|h\|_\infty+1)]$, $|g'|\leq|h|+1$, and $h=g'$ on $F$. Now multiply $g'$ by a continuous function that is between $0$ and $1$, $1$ on $[-k,k]$ and $0$ outside of $[-k-1,k+1]$, to obtain a continuous function $g$ such that $g=g'$ on $[-k,k]$, $g=0$ outside $[-k-1,k-1]$. 
Then
$$
\int|f-g|\leq\int|f-h|+\int|h-g|\leq\varepsilon/3+\int|h-g|=\varepsilon+\int_F|h-g|+\int_{[-k-1,k+1]\setminus F}|h-g|+\int_{\mathbb R\setminus[-k-1,k+1]}|h-g| \\ \ \\
=\varepsilon/3+\int_{[-k-1,k+1]\setminus F}|h-g|+\int_{\mathbb R\setminus[-k-1,k+1]}|h| \\ \ \\
\leq2\varepsilon/3+\int_{[-k-1,k+1]\setminus F}|h-g|\\ \ \\
\leq2\varepsilon/3+2(\|h\|_\infty+1)\,m([-k-1,k+1]\setminus F)<\varepsilon.
$$
