Show: $ (\mu\otimes\lambda)(A_f)=\int_{\Omega}f\, d\mu=\int_0^{\infty}\mu(\left\{f\geq x\right\})\, d\lambda(x)$ 

Let $(\Omega,\mathcal{A},\mu)$ be a $\sigma$-finite measure space and $\lambda$ be the Lebesgue-measure on $\mathbb{R}$. Moreover let $f\geq 0$ be a measurable numerical function on $\Omega$. Show, that for the set
    $$
A_f:=\left\{(\omega,x)\in\Omega\times\mathbb{R}: 0\leq x\leq f(\omega)\right\}
$$
    it is
    $$
(\mu\otimes\lambda)(A_f)=\int_{\Omega}f\, d\mu=\int_0^{\infty}\mu(\left\{f\geq x\right\})\, d\lambda(x).
$$
    Hint for the proof: First show the assumption for elementar functions and approximate any non-negative measurable function by elementar functions from below.


Hello!
Following the given hint, I first tried to show it for an (non-negative) elementar function, i.e. $f\colon\Omega\to [0,\infty)$ with $f:=\sum_{i=1}^{n}\alpha_i 1_{A_i}$, whereat $A_i, i=1,\ldots,n\in\mathcal{A}$ pairwise disjoint and $\alpha_i\geq 0$.
$$
(\mu\otimes\lambda)(A_f)=\int_{\Omega}\int_{\mathbb{R}}(1_{A_f})_{\omega}(x)\, d\lambda(x)\, d\mu(\omega)=\int_{\Omega}\int_0^{f(\omega)}\, d\lambda(x)\, d\mu(\omega)=\int_{\Omega}\lambda([0,f(\omega)])\, d\mu(\omega)\\=\int_{\Omega}f(\omega)\, d\mu(\omega)=\sum_{i=1}^{n}\alpha_i\mu(A_i)
$$
Now I start from the RHS:
$$
\left\{ f\geq x\right\}=\biguplus_{i=1}^{n}\left\{f=\alpha_i: \alpha_i\geq x\right\}
$$
$$
\implies\int_0^{\infty}\mu(\left\{f\geq x\right\})\, d\lambda(x)=\int_0^{\infty}\sum_{i=1}^{n}\mu(\left\{f=\alpha_i: \alpha_i\geq x\right\})\, d\lambda(x)\\=\sum_{i=1}^{n}\int_{0}^{\infty}\mu(\left\{f=\alpha_i:\alpha_i\geq x\right\})\, d\lambda(x)\\=\sum_{i=1}^{n}\int_0^{\infty}\int_{\Omega}1_{\left\{f=\alpha_i: \alpha_i\geq x\right\}}(\omega)\, d\mu(\omega)\, d\lambda(x)\\=\sum_{i=1}^{n}\int_0^{\infty}\int_{\Omega}1_{\left\{f=\alpha_i\right\}}(\omega)1_{x\leq\alpha_i}(x)\, d\mu(\omega)\, d\lambda(x)\\=\sum_{i=1}^{n}\int_0^{\infty}1_{x\leq\alpha_i}(x)\underbrace{\int_{\Omega}1_{\left\{ f=\alpha_i\right\}}(\omega)}_{=\mu(A_i)}\, d\mu(\omega)\, d\lambda(x)\\=\sum_{i=1}^{n}\mu(A_i)\int_0^{\infty}1_{x\leq\alpha_i}(x)\, d\lambda(x)\\=\sum_{i=1}^{n}\mu(A_i)\underbrace{\int_0^{\alpha_i}\, d\lambda(x)}_{=\lambda([0,\alpha_i])=\alpha_i}\\=\sum_{i=1}^{n}\alpha_i\mu(A_i)
$$
So the assumption is shown for an (non-negative) elementar function.
Now let $f$ be a non-negative, numerical, measurable function. Then there exists a sequence $(f_n)$ of non-negative elementar functions with $f_n\uparrow f$.
Because $A_{f_n}\subset A_{f_{n+1}}$ and $A_{f_n}\uparrow A_f$ it is with the continuity of the measure and Beppo Levi
$$
(\mu\otimes\lambda)(A_f)=\lim_{n\to\infty}(\mu\otimes\lambda)(A_{f_n})=\lim_{n\to\infty}\int_{\Omega}f_n\, d\mu=\int_{\Omega}f\, d\mu.
$$
Furthermore by Beppo Levi it is
$$
\int_{\Omega}f\, d\mu=\lim_{n\to\infty}\int_{\Omega}f_n\, d\mu\\=\lim_{n\to\infty}\int_{0}^{\infty}\mu(\left\{f_n\geq x\right\})\, d\lambda(x)
$$
Now the only thing that remains to show is that
$$
\lim_{n\to\infty}\int_{0}^{\infty}\mu(\left\{f_n\geq x\right\})\, d\lambda(x)=\int_0^{\infty}\mu(\left\{f\geq x\right\})\, d\lambda(x)
$$
Unfortunately, I do not see that.
Can you explain that to me?
With greetings!
math12
 A: Another way of showing the result, without taking the route via simple functions, is to use Tonelli's theorem (which applies thanks to $\sigma$-finiteness and positivity of the integrand) and write $$\int_{0}^{\infty}\mu\left\{ f\geq x\right\} d\lambda=\int\int\chi_{\left\{ 0<x\leq f\right\} }d\mu d\lambda\overset{\text{Tonelli}}{=}\int\int\chi_{\left\{ 0<x\leq f\right\} }d\lambda d\mu=\int\int_{0}^{f}d\lambda d\mu=\int fd\mu.$$
This shows equality of the integrals, and note that the second term is exactly the product measure of $A_f$, again by Tonelli's theorem.
Edit: Note that as pointed out in the comments by @triple_sec, this takes for granted the measurability of the involved functions.
A: Since $f_n\uparrow f$, then $\{f_n\geq x\}\uparrow \{f\geq x\}$ and hence also $\mu(\{f_n\geq x\})\uparrow \mu(\{f\geq x\})$, so the claim follows from the monotone convergence theorem.

To show the measurability of $x\mapsto \mu(\{g\geq x\})$ for measurable $g:\Omega\to\mathbb{R}$, we need the following result:

Let $(X,\mathcal{E},\mu)$ and $(Y,\mathcal{F},\nu)$ be two $\sigma$-finite measure spaces. Let also $U\in\mathcal{E}\otimes\mathcal{F}$ and define the sets
  $$
U_x=\{y\in Y\mid (x,y)\in U\},\quad U^y=\{x\in X\mid (x,y)\in U\}.
$$
  Then $U_x\in\mathcal{F}$, $U^y\in\mathcal{E}$ and if we define the mappings $\varphi_U: X\to [0,\infty)$ and $\psi_U:Y\to [0,\infty)$ by
  $$
\varphi_U(x)=\nu(U_x),\quad \psi_U(y)=\mu(U^y),
$$
  then $\varphi_U$ is $\mathcal{E}$-$\mathcal{B}(\mathbb{R})$-measurable and $\psi_U$ is $\mathcal{F}$-$\mathcal{B}(\mathbb{R})$-measurable

If we define $H$ by
$$
H=\{(\omega,x)\in\Omega\times \mathbb{R}\mid 0\leq x\leq g(\omega)\}
$$
then 
$$
H=p_2^{-1}([0,\infty))\cap(f\circ p_1-p_2)^{-1}([0,\infty))\in \mathcal{A}\otimes\mathcal{B}(\mathbb{R})
$$
where $p_1$ and $p_2$ are the projections on $\Omega\times \mathbb{R}$ (which are measurable). Now,
$$
H^x=\{\omega\in\Omega\mid (\omega,x)\in H\}=
\begin{cases}
\varnothing,\quad &\text{if }x<0,\\
\{g\geq x\},\quad &\text{if }x\geq 0,
\end{cases}
$$
and by the result above we get that
$$
x\mapsto \mu(\{f\geq x\})=\mu(H^x)
$$
is Borel-measurable.
A: $\textbf{Claim 1:}\quad$ The map $x\mapsto\mu(\{\omega\in\Omega\,|\,h(\omega)\geq x\})$ from $\mathbb R$ to $\overline{\mathbb R}$ is non-increasing for any measurable function $h:\Omega\to\mathbb[0,\infty]$.
$\textit{Proof:}\quad$ Clearly, if $x,x'\in\mathbb R$ and $x<x'$, then $$\{\omega\in\Omega\,|\,h(\omega)\geq x'\}\subseteq \{\omega\in\Omega\,|\,h(\omega)\geq x\},$$
since the set on the right-hand side has a laxer lower bound. Now the claim follows from the monotonicity of measures. (Note that both sets are measurable, since they are upper contour sets of $h$, which is a measurable function.) $\blacksquare$
$\textbf{Claim 2:}\quad$ If $g:\mathbb R\to\overline{\mathbb R}$ is a non-increasing function, and $a,b\in[-\infty,\infty]$ with $a<b$, then the set $$G\equiv\{x\in\mathbb R\,|\,g(x)\in(a,b)\}$$
is (i) empty, (ii) a singleton, or (iii) an interval.
$\textit{Proof:}\quad$ Let $$G_b\equiv\{x\in\mathbb R\,|\,g(x)<b\}$$ and $$G_a\equiv\{x\in\mathbb R\,|\,g(x)>a\}.$$ Clearly, $G=G_a\cap G_b$. Let's focus on $G_b$ first. Let $$x_b\equiv\sup\{x\in\mathbb R\,|\,g(x)\geq b\}.$$ By convention, if this set is empty (implying that $G_b=\mathbb R$), then $x_b=-\infty$. If, on the other hand, $\{x\in\mathbb R\,|\,g(x)\geq b\}$ is non-empty, then we will show that either $G_b=(x_b,\infty)$ or $G_b=[x_b,\infty)$.
Small digression: we can assume that $x_b$ is finite without loss of generality. Clearly, if the set $\{x\in\mathbb R\,|\,g(x)\geq b\}$ is non-empty, then $x_b>-\infty$. On the other hand, if $x_b=\infty$, then $g(x)\geq b$ for all $x\in\mathbb R$, since $g$ is non-increasing (if it went below $b$ at some point, it would stay below $b$ thereafter, which would imply that $x_b<\infty$). In this case, $G_b$ is empty and so is $G$, which would immediately complete the proof. So, from now on, focus on the cases in which $x_b\in(-\infty,\infty)$.
There are two cases:


*

*Case 1: $g(x_b)\geq b$. In this case, if $g(x)<b$, then $x>x_b$ (since $g$ is non-increasing), implying that $G_b\subseteq (x_b,\infty)$. Conversely, if $x>x_b$, then $g(x)<b$, since $g(x)\geq b$ would contradict the supremum property of $x_b$. This implies that $x\in G_b$. Hence, $(x_b,\infty)\subseteq G_b$. Conclusion: $G_b=(x_b,\infty)$.

*Case 2: $g(x_b)<b$. Now, suppose that $x\in G_b$. If $x<x_b$ (for the sake of contradiction), then, by the supremum property of $x_b$, there exists some $x'\in(x,x_b]$ such that $g(x')\geq b$. That is, $x<x'$, but (since $x\in G_b$) $g(x)<b\leq g(x')$, contradicting $g$ being non-increasing. Hence, we have that $x\geq x_b$. This implies that $G_b\subseteq [x_b,\infty)$. Next, if $x\geq x_b$, then $g(x)\leq g(x_b)<b$, so that $x\in G_b$. Conclusion: $G_b=[x_b,\infty)$.
Hence, $$G_b\in\{\mathbb R,(x_b,\infty),[x_b,\infty)\},$$ and, by the same token, $$G_a\in\{\mathbb R,(-\infty,x_a),(-\infty,x_a]\},$$ where $$x_a\equiv\inf\{x\in\mathbb R\,|\,g(x)\leq a\}.$$ Again, there is no loss of generality in assuming that $x_a$ is finite.
Now, $G=G_a\cap G_b$ can take one of following forms: $$\mathbb R,(x_b,\infty),[x_b,\infty),(-\infty,x_a),(-\infty,x_a],(x_b,x_a),(x_b,x_a],[x_b,x_a),[x_b,x_a].$$ The first five of these are unambiguously infinite intervals. The last four sets are empty if $x_b>x_a$. (In fact, one can prove that $x_b\leq x_a$ holds, but we don't need this for the desired result.) If $x_b=x_a$, then the last one is a singleton, while $(x_b,x_a)$, $(x_b,x_a]$, and $[x_b,x_a)$ are still empty. Finally, if $x_b<x_a$, then the last four are non-degenerate finite intervals. In particular, $G$ is measurable in all cases. $\blacksquare$
