Riemann integral and Lebesgue integral $f:R\rightarrow [0,\infty)$ is a Lebesgue-integrable function. Show that
$$
\int_R f \ d m=\int_0^\infty m(\{f\geq t\})\ dt
$$
where $m$ is Lebesgue measure.
I know the question may be a little dump.
 A: We have, using Fubini and denoting by$\def\o{\mathbb 1}\def\R{\mathbb R}$ $\o_A$ the indicator function of a set $A \subseteq \R$ 
\begin{align*}
  \int_\R f(x)\, dx &= \int_\R \int_{[0,\infty)}\o_{[0,f(x)]}(t)\, dt\,dx\\
        &= \int_{[0,\infty)} \int_\R \o_{[0,f(x)]}(t)\, dx\, dt\\
        &= \int_{[0,\infty)} \int_\R \o_{\{f \ge t\}}(x)\, dx\, dt\\
        &= \int_{[0,\infty)} m(\{f\ge t\})\, dt.
\end{align*}
For the third line note that 
\begin{align*}
  \o_{[0,f(x)]}(t) = 1 &\iff 0 \le t \le f(x)\\
                       &\iff f(x) \ge t\\
                       &\iff x \in \{f\ge t\}\\
                       &\iff \o_{\{f\ge t\}}(x) = 1
\end{align*}
and hence $\o_{[0,f(x)]}(t) =  \o_{\{f \ge t\}}(x)$ for all $(x,t) \in \R \times [0,\infty)$.
A: First note that
$$
\int_0^{f(x)}1\,{\rm d}t
~=~
f(x)
$$
since $f(x)$ is constant with respect to variable $t$, so
$$
\int_{\mathbb R}f(x)\,{\rm d}m
~=~
\int_{\mathbb R}
\left(
  \int_0^{f(x)}1\,{\rm d}t
\right){\rm d}m
$$
Now let $\chi_A(x)$ be the characteristic function of the set $A$, i.e.
$$
\chi_A(x) =
\begin{cases}
1 & \text{if }x\in A \\
0 & \text{if }x\notin A
\end{cases}
$$
so that the previous expression turns out to be equal to
$$
\int_{\mathbb R}f(x)\,{\rm d}m
~=~
\int_{\mathbb R}
\left(
  \int_0^{+\infty}\chi_{[0,f(x)]}(t)\,{\rm d}t
\right){\rm d}m
$$
Now the crucial observation is that since $f(x)\geq 0$ then
$$
\chi_{[0,f(x)]}(t)
~=~
\chi_{\{f\geq t\}}(x)
\quad \forall t\geq 0
$$
Now, going back to the integral,
$$
\int_{\mathbb R}f(x)\,{\rm d}m
~=~
\int_{\mathbb R}
\left(
  \int_0^{+\infty}\chi_{\{f\geq t\}}(x)\,{\rm d}t
\right){\rm d}m
~=~
\int_{\mathbb R}
m\left(
 \{f\geq t\}
\right){\rm d}t
$$
