I have found some notes about measure theory where it is used the following equality
$$\int_A f \, dx=\int_0^\infty \mu_A(\lambda)\,d\lambda,$$ where $f$ is a positive Lebesgue integrable function and $\mu_A(\lambda)$ is the Lebesgue measure of the set $\{x\in A:f(x)>\lambda\}$.
Could somebody justify that equality?
This answer will follow up on "kimchi lover" 's answer and also add three remarks.
\begin{align} \int\limits_{[0,+\infty)} \mu_A(\lambda)\,d\lambda & = \int\limits_{[0,+\infty)} \left( \,\, \int\limits_{x\,:\, f(x)\,>\,\lambda\ \&\ x\,\in\,A} 1 \, dx \right) \, d\lambda \\[10pt] & = \iint\limits_{x,\lambda\,:\,0 \,\le\,\lambda\,<\,f(x)\ \&\ x\,\in \,A} 1\, d(x,\lambda) \\[10pt] & = \int\limits_A \left( \,\, \int\limits_{\lambda\,:\, 0\,\le\,\lambda\,<\,f(x)} 1\,d\lambda \right) \, dx \\[10pt] & = \int\limits_A f(x) \,dx. \end{align} Note well that
Tonelli's theorem rather than Fubini's theorem entails the equalities on the second and third lines above, simply because the function being integrated, which is everywhere equal to $1,$ is everywhere nonnegative;
Fubini's theorem can also entail those equalities provided the $2$-dimensional Lebesgue measure of the set $\{(x,\lambda) : 0 \le \lambda < f(x) \ \&\ x\in A \}$ is finite. Do we have that? In the case in which I've done this problem before, $A$ was a probability space, so that was no problem.