Show: $\int f\, d\mu=\int\limits_0^{\infty}\mu(\left\{x\in X: f(x)>t\right\})\, dt$ 

Let $f\colon X\to\overline{\mathbb{R}}_{\geq 0}$ be a measurable function. Show that
    $$
\int f\, d\mu=\int\limits_0^{\infty}\mu(\left\{x\in X: f(x)>t\right\})\, dt.
$$
    (The right integral is to be read as an Lebesgue-integral.)


Hello, my idea is to approximate $f$ by the functions
$$
f_n:=2^{-n}\sum\limits_{k=1}^{\infty}\chi_{\left\{x\in X: f(x)> k/2^n\right\}}.
$$
With this approximation by simple functions I got
$$
\int\limits_X f\, d\mu=\lim\limits_{n\to\infty}\int\limits_X f_n\, d\mu=\lim\limits_{n\to\infty}\sum\limits_{k=1}^{\infty}\frac{k}{2^n}\cdot\mu\left(\left\{x\in X: f_n(x)=k/2^n\right\}\right)\\=\lim\limits_{n\to\infty}\sum\limits_{k=1}^{\infty}\frac{k}{2^n}\cdot\mu\left(\left\{x\in X:f(x)>k/2^n\right\}\right)
$$
This is the point where I do not come along anymore... is that right to this point and if yes: How can I continue in order to get the desired right side?
With regards
 A: You do not need to use the approximation of $f$. You can compute directly. Here is the detail: by Fubini's Theorem,
\begin{eqnarray*}
\int_0^\infty\mu(\{x\in X: f(x)>t\})dt&=&\int_0^\infty\int_{X}\chi_{\{x\in X: f(x)>t\}}(y)\;d\mu(y)\;dt\\
&=&\int_{X}\int_0^\infty\chi_{\{x\in X: f(x)>t\}}(y)\;dt\;d\mu(y)\\
&=&\int_X\int_0^{f(y)}dt\;d\mu(y)\\
&=&\int_Xf(y)\;d\mu(y).
\end{eqnarray*}
A: If $\phi$ is a nonnegative simple function taking values $0 = c_0 < c_1 < c_2 < \cdots < c_n$ on the disjoint sets $E_0, E_1, \ldots, E_n$, then for $t \ge 0$ you have $$\{\phi > t\} = E_k \cup \cdots \cup E_n$$ whenever $c_{k-1} \le t < c_k$ for all $1 \le k \le n$, and $\{\phi > t\} = \emptyset$ if $t \ge c_n$. Thus
$$ \int_0^\infty \mu(\{ \phi > t\}) \, dt = \sum_{k=1}^n \int_{c_{k-1}}^{c_k} \mu(\{ \phi > t\}) \, dt = \sum_{k=1}^n (c_k - c_{k-1}) (\mu(E_k) + \cdots + \mu(E_n)).$$
It is straightforward (i.e. just write it out) that
$$ \sum_{k=1}^n (c_k - c_{k-1}) (\mu(E_k) + \cdots + \mu(E_n)) = \sum_{k=1}^n c_k \mu(E_k) = \int_X \phi \, d\mu.$$
So, the result is true for simple functions. Try to carry out the general case using the usual limiting tools.
