# Problem with Lebesgue-integral of measurable set and Lebesgue-integrable function

I am trying to show, that

Let $\Omega \subset \mathbb{R}^n$ be measurable and $f\colon \Omega \rightarrow [0,\infty)$ Lebesgue-integrable. Show that: $$\int_\Omega f(x)dx=\int_0^\infty \lambda(\{f>s\})\; ds.$$

Can somebody explain to me, why for $(x,s) \in \Omega \times \mathbb{R}$ is $\chi_{[0,f(x))}(s)=\chi_{[0,\infty)}(s)\chi_{\{f>s\}}(x)$?

To show that $\chi_{[0,f(x))}(s)=\chi_{[0,\infty)}(s)\chi_{\{f>s\}}(x)$, you just have to check that when one is equal to $1$ so is the other, and vice versa.
$\chi_{[0,f(x))}(s)=1$ if $s\in [0,f(x))$, that is equivalent to $f(x) >s\ge0$. Now when $f(x) >s\ge0$ you have that: $\chi_{\{f>s\}}(x)=1$, because $x$ is in the set $\{f>s\}$ ; $\chi_{[0,\infty)}(s)=1$ because $s\ge0$. This show that if $\chi_{[0,f(x))}(s)=1$ then $\chi_{[0,\infty)}(s)\chi_{\{f>s\}}(x)=1.$ The other part is almost identical.
$$\int_{\Omega}f(x)dx=\int_{\Omega}\int_{\Bbb R}\chi_{[0,f(x))}(s) dsdx=\int_{\Bbb R}\int_{\Omega}\chi_{[0,\infty)}(s)\chi_{\{f>s\}}(x)dxds=\int_0^\infty \lambda{\{f>s\}}ds.$$