$f\in L^1$ iff $\sum\limits_{i\in\mathbb{N}}2^n\mu(A_n)<\infty$ I want to show that the measurable function $f:[0,1]\to\mathbb{R}^+$ is in $L^1([0,1])$ if and only if $$\sum\limits_{i\in\mathbb{N}}2^i\mu(A_i)<\infty$$ for $$A_i:=\{x\in[0,1]\mid 2^i\leq f(x)<2^{i+1}\}.$$
I saw a similar example here but I didn't fully understand what was going on there.
If I define the function $$g(x):=\sum_{i\in\mathbb{N}}2^i\chi_{A_i},$$ where $\chi_{A_i}$ is the indicator function, then I basically have to show $$\int_{[0,1]}|f|\,\mathrm{d}\mu<\infty\iff\int_{[0,1]}g\,\mathrm{d}\mu<\infty.$$
I'm not sure how to continue here, but I thought about expressing $f$ in a sum of indicator functions on $A_i$ and then estimating the sum ?
Any hints would be appreciated. Thanks :)
 A: Given $x\in [0,1]$, there exists a maximal natural number $k$ such that
$f(x)\geq 2^k$. Maximality of $k$ implies that $f(x)<2^{k+1}$. Therefore,
$x\in A_k$.
This implies that for every $x$,
$$f(x)/2 < \sum_{i=1}^{\infty}\chi_{A_i}(x)2^i\leq f(x)$$
where $\chi_{A_i}$ is the indicator function of $A_i$.
The r.h.s and the l.h.s both follow from the fact that with $k$ as above the middle sum equals $2^k$, and that $2^k\leq f(x)<2^{k+1}$.
It follows that $f$ is integrable if and only if the middle sum is integrable, which is equivalent to the convergence of the given series.
A: I am under the impression that this question has been asked before. In fact The following holds:

Suppose $\mu$ is finite and $\{a_n:n\in\mathbb{N} \}$ is a positive increasing sequence with $c a_{n+1}\leq a_n\nearrow\infty$ for some $0<c<1$.
$f\in L_1(\mu)$ iff and $\sum_ma_k\mu(\{a_k<|f|\leq a_{k+1}\})<\infty$

If $f\in L_1$,  then for all $k\in\mathbb{N}$. we have
$$a_k\mu(\{a_k<|f|\leq a_{k+1}\})\leq\int_{\{a_k<|f|\leq a_{k+1}\}}|f|\,d\mu$$
and the conclusion follows
Conversely, if  $\sum_ma_k\mu(\{a_k<|f|\leq a_{k+1}\})<\infty$,
$$
\int_{\{a_k<|f|\leq a_{k+1}\}}|f|\,d\mu\leq a_{k+1}\,\mu(\{a_k<|f|\leq a_{k+1}\})\le  \frac{1}{c}a_k\,\mu(\{a_k<|f|\leq a_{k+1}\})
$$
and so $\int_{\{a_1<|f|\}}|f|\,d\mu<\infty$ whence we conclude that $f\in L_1$.
