How to show that $\int u d \mu = \int_0^{\infty} \mu (u^{-1}((t,\infty))) d t$ for $u \colon X \to \mathbb{R}^+$ measurable? On a measure space $(X, \mathscr{A}, \mu)$ we have a measurable funtion $u \colon X \to \mathbb{R}^+$, and want to show that
$$\int u d \mu = \int_0^{\infty} \mu (u^{-1}(t,\infty)) dt.$$
I've been given the hint to try for simple functions first, and someone said to try MCT, but I simply can't get it to go anywhere still:
What I've tried:
We know that $\mu (u^{-1}(t,\infty)) = \int 1_{u^{-1}(t,\infty)} d\mu$ is decreasing and
\begin{align*}
\lim_{n \to \infty} \mu (u^{-1}(-n, \infty))
&= \lim_{n \to \infty} \int 1_{u^{-1}(-n,\infty)} d\mu\\
&= \int 1_X d\mu\\
&= \mu(X).
\end{align*}
\begin{align*}
\lim_{n \to \infty} \mu (u^{-1}(n, \infty))
&= \lim_{n \to \infty} \int 1_{u^{-1}(n,\infty)} d\mu\\
&= \int 1_\varnothing d\mu\\
&= \mu(\varnothing)= 0.
\end{align*}
If $u= \sum_{n=1}^m c_n 1_{A_n}, \quad c_i \geq 0$, we have
$$ \int u d\mu = \sum_{n=1}^m c_n \mu(A_n). $$
I don't see how to connect the two.
 A: Surbs and Dominik Kuteks answers are very elegant but as you said that your course have yet to go through Fubinis theorem here is a possible way to go with the proof. Note that this is not a real proof just a outline.
I would probably start with proving this is true for simple functions, just choosing a easy case like $u(x)=\left\{\begin{matrix}
y_1, \text{if }x\in A_1\\ 
y_2, \text{if }x\in A_2
\end{matrix}\right.$ then we have $\int u(x)d\mu=y_1 \mu(A_1)+y_2\mu(A_2)$ and our riemann integral is $$\int_0^\infty \mu(u^{-1}(x,\infty))dx=\int_0^{y_1}\mu(u^{-1}(x,\infty))dx+\int_{y_1}^{y_2}\mu(u^{-1}(x,\infty))dx+\int_{y_2}^{\infty}\mu(u^{-1}(x,\infty))dx=y_1(\mu(A_1)+\mu(A_2))+(y_2-y_1)\mu(A_2)=y_1\mu(A_1)+y_2\mu(A_2)$$ Can we generalize this process?
Now use that any measurable function is the uniform limit of a increasing sequence of simple measurable functions, the most popular incarnation of this is probably $$u_n(x)=\left\{\begin{matrix}
\frac{k}{2^n}, \text{if }x\in u^{-1}[\frac{k}{2^n},\frac{k+1}{2^n})\\ 
0, \text{else }
\end{matrix}\right.$$
This sequence if increasing(why?) and so $\mu(u_n^{-1}(t,\infty))$ is also increasing!(motivate why) Then we just need justify that $\underset{n\rightarrow \infty}{\lim}\mu(u_n^{-1}(x,\infty))\rightarrow \mu(u^{-1}(x,\infty))$ remebering $u_n(x)\rightarrow u(x)$ uniformly(this hopefully is not to messy). Then we can probably just use the monotone convergence theorem and get the desired result. I hope this works!
EDIT: Just to fix some of the things I wrote. $u_n(x)\rightarrow u(x)$ need not be uniform as $u(x)$ might not be bounded so we only have pointwise convergence and not uniform.
Regarding the limit $\underset{n\rightarrow \infty}{\lim}\mu(u_n^{-1}(m,\infty))\rightarrow \mu(u^{-1}(m,\infty))$, not knowing your exact background I use a pretty common theorem for measures.
$\textbf{Theorem:}$ Given a increasing sequence of measurable sets $X_1\subseteq X_2\subseteq...$ we have that $$\underset{n\rightarrow \infty}{\lim}\mu(X_n)=\mu(\bigcup_{n=1}^\infty X_n)$$
A proof of this can be found in kolmogorv & Fomins book introductory real analysis page 266 as the collorary to theorem 11.
now we prove that $$\bigcup_{k=1}^\infty\bigcup_{n=1}^\infty\{x:u_n(x)>m+\dfrac{1}{k}\}=\{x:u(x)>m\}$$
$(\subseteq)$ This is quite easy as we may choose big enough $n$ such that $|u(x)-u_n(x)|<\dfrac{1}{k}$ and so $u(x)>u_n(x)-\dfrac{1}{k}=m$
($\supseteq$) given that $u(x)>m$ there is a $k$ such that $u(x)>m+\dfrac{2}{k}$, to prove this suppose for contradiction that $u(x)\leq m-\dfrac{2}{k}$ for all $k$ then clearly $u(x)\leq m$ a contradiction. So now that $u(x)>m+\dfrac{2}{k}$ choosing big enough $n$ such that $|u(x)-u_n(x)|<\dfrac{1}{k}$ we have that $u_n(x)>u(x)-\dfrac{1}{k}=m+\dfrac{1}{k}$.
We can prove that $$ \bigcup_{k=1}^{\infty}\bigcup_{n=1}^{\infty}\{x:u_n(x)>m+\dfrac{1}{k}\}=\bigcup_{n=1}^{\infty}\{x:u_n(x)>m\}$$ Using the exact method we just used. Now just use our theorem to conclude that $$ \mu(\bigcup_{k=1}^{\infty}\bigcup_{n=1}^{\infty}\{x:u_n(x)>m+\dfrac{1}{k}\})=\underset{n\rightarrow \infty}{\lim}\mu(\bigcup_{k=1}^{\infty}\{x:u_n(x)>m+\dfrac{1}{k}\})=\underset{n\rightarrow \infty}{\lim}\mu(\{x:u_n(x)>m\})=\mu(\{x:u(x)>m\})$$
Which is exactly what we wanted to prove.
A: \begin{align*}
\int_0^\infty u(x)\mu(\mathrm d  x)&=\int_0^\infty \int_0^{u(x)}\,\mathrm d t\,\mu(\mathrm d x).\\
&=\int_0^\infty \int_0^{\infty }\boldsymbol 1_{\{u(x)>t>0\}}\,\mathrm d t\,\mu(\mathrm d x)\\
&\underset{\text{Fubini}}{=}\int_0^\infty \int_0^\infty \boldsymbol 1_{\{u(x)>t\}}\,\mu(\mathrm d x)\,\mathrm d t\\
&=\int_0^\infty \mu\{u(x)>t\}\,\mathrm d t.
\end{align*}
