Prove that $f^2$ is Lebesgue integrable if and only if $\sum_{k=1}^\infty k \cdot m\{x\in A: |f(x)|>k\}<\infty.$ 
Question: Let $f$ be a Lebesgue measurable function on $A$ with $m(A)<\infty.$
  Prove that $f^2$ is Lebesgue integrable if and only if 
  $$\sum_{k=0}^\infty k\cdot m\{x\in A: |f(x)|>k\}<\infty.$$

My attempt: 
For each $k\geq 0,$ denote
$$A_k=\{x\in A: f^2(x)>k^2 \} = \{x\in A: |f(x)|>k\}.$$
Observe that the union 
$$A = \bigcup_{k=0}^\infty (A_k\setminus A_{k+1})$$
is disjoint. 
It follows that 
$$\int_A f^2 = \int_{\bigcup_{k=0}^\infty (A_k\setminus A_{k+1})}f^2 = \sum_{k=0}^\infty \int_{A_k \setminus A_{k+1}} f^2.$$
I am not sure whether the following inequality
$$ k \cdot m\{x\in A: |f(x)|>k\} \leq \int_{A_k\setminus A_{k+1}}f^2 \leq (k+1) \cdot m\{x\in A: |f(x)|>k\}.$$
holds.
If it does, then I am done. 
 A: You are on the right track. Just keep in mind that the estimate is not for each $\int_{A_k\setminus A_{k+1}}f^2$, but for the whole integration instead. For example,
\begin{align}
\int_Af^2&=\sum_{k=0}^{\infty}\int_{A_k\setminus A_{k+1}}f^2\\
&>\sum_{k=0}^{\infty}\int_{A_k\setminus A_{k+1}}k^2\\
&=\sum_{k=0}^{\infty}k^2m(A_k\setminus A_{k+1})\\
&=\sum_{k=0}^{\infty}k^2\left(m(A_k)-m(A_{k+1})\right)\\
&=\sum_{k=0}^{\infty}k^2m(A_k)-\sum_{k=0}^{\infty}k^2m(A_{k+1})\\
&=\sum_{k=0}^{\infty}k^2m(A_k)-\sum_{k=1}^{\infty}\left(k-1\right)^2m(A_k)\\
&=\sum_{k=1}^{\infty}k^2m(A_k)-\sum_{k=1}^{\infty}\left(k-1\right)^2m(A_k)\\
&=\sum_{k=1}^{\infty}\left[k^2-\left(k-1\right)^2\right]m(A_k)\\
&=\sum_{k=1}^{\infty}\left(2k-1\right)m(A_k)\\
&>\sum_{k=1}^{\infty}k\cdot m(A_k).
\end{align}
Similar trick applies to
$$
\int_Af^2=\sum_{k=0}^{\infty}\int_{A_k\setminus A_{k+1}}f^2\le\sum_{k=0}^{\infty}\int_{A_k\setminus A_{k+1}}\left(k+1\right)^2,
$$
and you will figure out the other bound.
A: You only have
$$k^2 \lambda(A_k \setminus A_{k+1}) \leq \int_{A_k \setminus A_{k+1}} f^2 \mathrm{d} \mu \leq \lambda \leq (k+1)^2 \lambda(A_k \setminus A_{k+1}).$$
However, noting that
\begin{align}
\sum_{k=1}^\infty k \lambda(x \in A \colon |f(x)| >k) &= \sum_{k=1}^\infty k \sum_{i=k}^\infty \lambda(A_i \setminus A_{i +1}) \\
&= \sum_{i=1}^\infty \lambda(A_i \setminus A_{i+1}) \sum_{k=1}^i k \\
&= \frac{1}{2} \sum_{i=1}^\infty i (i+1) \lambda(A_i \setminus A_{i+1}),
\end{align}
we are done.
