Let $f:\mathbb{R}\rightarrow\mathbb{R}$ Lebesgue integrable. Let $\varepsilon >0$ exist a finite interval $[a,b]$ and a bounded function $h$ such that $h(x)=0$ if $x\not\in[a,b]$ then
$$\int_{-\infty}^{\infty}{|f(x)-h(x)|}dx<\varepsilon.$$
My attempt:
As $f$ is Lebesgue integrable then $f<\infty$.
Let $$g_n(x)=\begin{cases}f(x)&\text{if}\ x\in[a,b]\\0&\text{otherwise},\end{cases}$$
Note that $g_n\rightarrow f$, then apply the Dominate convergence theorem
$$\int_{a}^{b} g_n\,dx \to \int f\,dx$$
Here, I'm stuck. Can someone help me?
You have to find $[a,b]$ and $h$. Your argument does not work. Take $g_n(x)=fI_{\{x:|f(x)| \leq n\}} I_{[-n,n]}(x)$ and apply DCT. Take $h=g_n$, $a=-n$ and $b=n$ with $n$ sufficiently large.