# If $f$ is Lebesgue integrable, then for every $\epsilon>0$ there is a set $E$ of finite measure such that $\int_{E^c}|f|<\epsilon$

If we have a measure space $(X,M,\mu)$ and $f$ is a real function on $X$ such that $$\int_X |f| d\mu <\infty$$ ( in other word $f$ integrable). How to prove that for any $\epsilon >0$ we can find a measurable set $E$ such that $\mu(E) <\infty$ and $$\int_{X \backslash E} |f| d\mu <\epsilon$$

My attempt was come from the fact $|f|=f^{+}+f^{-}$ and since $f^{+}$ is nonnegative function so I was able to find a bounded function $h$ with finite support that is :-

$\int_E f^{+} < \int_E h - \epsilon$. and really I stuck here . so are my approach is make sense to this problem and what should I do from here ?

For each $n\in\mathbb N_1$, set $E_n=|f|^{-1}[(\frac1n,\infty)]$ and $E_0=\varnothing$. Because $f$ is integrable, $\mu(E_n)<\infty$. Let $F=\bigcup_{n\in\mathbb N_1} E_n$ and $F_n=E_n\setminus E_{n-1}$. These sets form a disjoint partition of $F$ because $E_0\subseteq E_1\subseteq \ldots$, so from the countable additivity we have $$\infty>\int_F|f|\,d\mu=\sum_{n=1}^\infty\int_{F_n}|f|\,d\mu,$$ which means for any $\varepsilon>0$ there's $n\in\mathbb N_1$ such that $$\varepsilon>\sum_{k=n+1}^\infty\int_{F_k}|f|\,d\mu=\int_{F\setminus E_n}|f|\,d\mu=\int_{X\setminus E_n}|f|\,d\mu$$ because $f$ is $0$ on $X\setminus F$.