let $f : [a,b] \to \mathbb{R}$ be Lebesgue measurable. For $n=1,2,\dots$ set
$$E_n = \{x \in [a,b] : n-1 \leq |f(x)| < n \}.$$ Show that $f$ is Lebesgue integrable if and only if $\sum_{n=1}^{\infty} n \mu (E_n) < \infty$. Here $\mu$ is the lebesgue measure.
I believe I need to represent $f$ as the limit of a sequence of $s_i$, simple measurable functions, however I think I may need $s_i$ to be in $E_n$ and I can not guarantee this. This is where I'm stuck. Any hint/help would be appreciated.
Hint: $\bigcup E_n = [a,b],$ and the $E_n$ are pairwise disjoint. Thus
$$\int_a^b|f| = \sum \int_{E_n}|f|.$$