Let $(X,\mathcal{A},\mu)$ a finite measurable space and $f:X\rightarrow[0,\infty]$ a measurable function. I want to show that the integrability of $f$ is equivalent to the convergence of the series
$$\sum_{n=0}^\infty 2^n\mu(\{x\in X\mid f(x)\geq2^n\})$$
I am trying to find a sequence of functions $f_n$ that converge to $f$, so maybe I get the previous series when I compute $$\lim_n\int f_n$$
So far I did not manage to do so, can someone tell me if I am going in the right direction, or point my towards it?