Equivalence of a Lebesgue Integrable function I have the following question:
Let $X$: $\mu(X)<\infty$, and let $f \geq 0$ on $X$.  Prove that $f$ is Lebesgue integrable on $X$ if and only if $\sum_{n=0}^{\infty}2^n \mu(\lbrace x \in X : f(x) \geq 2^n \rbrace) < \infty $.
I have the following ideas, but am a little unsure. For the forward direction:
By our hypothesis, we are taking $f$ to be Lebesgue integrable.  Assume $\sum_{n=0}^{\infty}2^n \mu(\lbrace x \in X : f(x) \geq 2^n \rbrace) = \infty $.  Then for any n, no matter how large, $\mu(\lbrace x \in X : f(x) \geq 2^n \rbrace)$ has positive measure.  Otherwise, the sum will terminate for a certain $N$, giving us $\sum_{n=0}^{N}2^n \mu(\lbrace x \in X : f(x) \geq 2^n \rbrace) < \infty $.  Thus we have $f$ unbounded on a set of positive measure, which in combination with $f(x) \geq 0$, gives us that $\int_E f(x) d\mu=\infty$.  This is a contradiction to $f$ being Lebesgue integrable.  So our summation must be finite.
For the reverse direction: 
We have that $\sum_{n=0}^{N}2^n \mu(\lbrace x \in X : f(x) \geq 2^n \rbrace) < \infty \\$.  Assume that $f$ is not Lebesgue integrable, then we have $\int_E f(x) d\mu=\infty$.  Since we are integrating over a finite set $X$, then this means that $f(x)$ must be unbounded on a set of positive measure, which makes our summation infinite, a contradiction.
Any thoughts as to the validity of my proof?  I feel as if there is an easier, direct way to do it.
 A: $$\frac12\left(1+\sum_{n=0}^{+\infty}2^n\,\mathbf 1_{f\geqslant2^n}\right)\leqslant f\lt1+\sum_{n=0}^{+\infty}2^n\,\mathbf 1_{f\geqslant2^n}$$
A: Let $E_n = \lbrace x \in X : 2^n \leq f(x) < 2^{n+1} \rbrace$.
Let $F = \lbrace x \in X : f(x) < 1 \rbrace$.
Then $X$ is a disjoint union of $F$ and $E_n$, $n = 0,1,\dots$.
Hence $\int_X f(x) d\mu = \int_F f(x) d\mu + \sum_{n=0}^{\infty} \int_{E_n} f(x) d\mu$.
Let $G_n = \lbrace x \in X : f(x) \geq 2^n \rbrace$.
Then $E_n = G_n - G_{n+1}$.
Let $m_n = \mu(G_n)$.
Since $\mu(E_n) = \mu(G_n - G_{n+1}) = m_n - m_{n+1}$, $2^n(m_n - m_{n+1}) \leq \int_{E_n} f(x) d\mu \leq 2^{n+1}(m_n - m_{n+1})$.
Hence
$\int_F f(x) d\mu + \sum_{n=0}^{\infty} 2^n(m_n - m_{n+1}) \leq \int_X f(x) d\mu \leq \int_F f(x) d\mu + \sum_{n=0}^{\infty} 2^{n+1}(m_n - m_{n+1})$
Let $s = \sum_{n=0}^{\infty} 2^n m_n$.
Suppose $f$ is integrable.
By the above left inequality,
$\sum_{n=0}^{\infty} 2^n(m_n - m_{n+1}) < \infty$.
Since $\sum_{n=0}^{\infty} 2^n(m_n - m_{n+1}) = m_0 + \sum_{n=0}^{\infty} 2^n m_{n+1} = m_0 + (\sum_{n=0}^{\infty} 2^{n+1} m_{n+1})/2 < \infty$, $s < \infty$.
Conversely suppose $s< \infty$.
Note that $\int_F f(x) d\mu < \infty$.
By the above right inequality, $\int_X f(x) d\mu \leq \int_F f(x) d\mu + \sum_{n=0}^{\infty} 2^{n+1}(m_n - m_{n+1}) = \int_F f(x) d\mu + 2m_0 + \sum_{n=0}^{\infty} 2^{n+1} m_{n+1} = \int_F f(x) d\mu + m_0 + s < \infty$.
A: Hint:  Switching the order of integration gives  $$\int_X f(x)\,\mu(dx)=\int_X \int_0^{f(x)}\,dt\,\mu(dx)
=\int_0^\infty \mu(x: f(x)>t)\,dt$$
This equation is true whether  the two sides are finite or infinite. 
Since  $G(t):= \mu(x: f(x)>t)$ is  decreasing, we have
$$G(2^{n+1}) \int_{2^n}^{2^{n+1}}\,dt 
\leq \int_{2^n}^{2^{n+1}} G(t) \,dt
\leq G(2^n) \int_{2^n}^{2^{n+1}}\,dt$$
and hence $\int_0^\infty G(t)\,dt<\infty$ if and only if 
$\sum_{n=0}^\infty 2^n G(2^n)<\infty.$
Also, see did's answer here.
A: This won't quite do. Your argument doesn't actually use the $2^n$ at all: it would read exactly the same if we asked only for $\sum_{n=0}^{\infty}\mu(\{x \in X: f(x) \geq 2^n\}) < \infty$. Yet $\frac{1}{x}$ satisfies this weaker hypothesis on $[0,1]$: the infinite sum becomes $\sum_{i=0}^\infty \frac{1}{2^i}=2$, while we know the integral diverges. See if you can try a similar approach that explicitly uses the exponential decay of the measure of sets on which $f$ is big.
A: The fact that the summation is infinite does not mean that it does not converge, consider $f(x)=\frac{1}{\sqrt x}$ on $[0,1]$. It is integrable, yet clearly the summation is not finite in this case: it is $\sum_n 2^n\cdot 2^{-2n}=2<\infty$.
Put $A_n:=\{ x\vert f(x)\geq 2^n\},B_n:=A_n\setminus A_{n+1},a_n=\mu(A_n)$. Then define $h_1=\sum_n2^{n+1}\chi_{B_n}$. Except for the points where $f<1$ or $f=\infty$ (which are resolved easily), we have $h_1/2\leq f\leq h_1$, so if $f$ is not infinite on a set of positive measure, $f$ is integrable iff $h_1$ is.
On the other hand, $$\int f\leq \int h_1=2\sum_{n\geq 0} 2^n(a_n-a_{n+1})\leq 2\sum_n 2^n a_n$$
Edit2:
Instead, take a look at $h_2:=\sum_n 2^{n-1}\chi_{A_n}$. Then for each $x\in B_n$ we have that $h_2(x)\leq \sum_{j\leq n}2^{j-1}<2^n\leq f(x)$, and $h_2\leq f$ almost everywhere, so if $f$ is integrable, $h_2$ is too. Then:
$$\int h_2=\sum_n 2^{n-1}\mu(A_n)=\frac{1}{2}\sum_n 2^n\mu(A_n)$$
so $\sum_n 2^n\mu(A_n)$ converges and we're done.
