# Prove that for any $\epsilon >0$ there exists a measurable set $E$ such that $m(E)<\infty$ and $\int_E f>(\int f)-\epsilon$.

Let $f$ be a non-negative measurable function on $\mathbb{R}$ such that $\int f<\infty$. It is required to prove that for any $\epsilon >0$ there exists a measurable set $E$ such that $m(E)<\infty$ and $\int_E f>(\int f)-\epsilon$. The following is my attempt.

Let $\epsilon >0$. Then there exists a simple function $\phi$ with $0\leq\phi\leq f$ such that $(\int f)-\epsilon<\int\phi$. Say $\sum_{k=1}^N a_k\ \chi_{E_k}$ is the canonical representation of $\phi$. Then $\int \phi=\sum_{k=1}^N a_k\ m(E_k)\leq\int f<\infty$. Define $E=\bigcup_{k=1}^N E_k$. Then $E$ is measurable and $m(E)<\infty$ and $\int \phi=\int_E\phi\leq\int_E f$. Hence the result.

Let $$f_n(x)=f(x)\chi_{[-n,n]}(x).$$ where $$\chi_{[-n,n]}$$ is the characteristic function of the interval $$[-n,n]$$. Then $$f_n$$ is an increasing sequence of non-negative measurable functions which converges point-wise to $$f$$. By virtue of the Monotone Convergence Theorem $$\int_{[-n,n]} f(x)\,dx=\int_{\mathbb R} f_n\to \int_{\mathbb R}f$$ Hence, for every $$\varepsilon>0$$, there exists an $$n_0\in\mathbb N$$, such that $$n\ge n_0 \,\,\quad\Longrightarrow\,\,\quad 0<\int_{\mathbb R}f(x)\,dx-\int_{[-n,n]}f(x)\,dx <\varepsilon.$$
You're very close. The problem is that $$m(E)$$ is not necessarily finite. For instance, if $$\phi(E_i)=0$$, for some $$1\leq i\leq N$$, then $$m(E_i)$$ might be infinite. However, $$m(E_i)=\infty$$ implies $$a_i=0$$.