How can I solve this problem $\def\R{\mathbb R}$
Suppose that $f$ is integrable on $\R^n$. For each $t>0,$ let $E_t = \{x:|f(x)|>t\}$.
Prove $\int_{\R^n}|f(x)|dx = \int_0^\infty \lambda(E_t)dt.$ More generaly, prove if $f \in L^p,$ then $$\int_{\R^n}|f(x)|^p\,dx = \int_0^\infty pt^{p-1}\lambda(E_t)\,dt.$$
I solve this problem in this way :
\begin{align*} \int_{\R^n}|f(x)|dx &= \int_{\R^n}\int_0^{|f(x)|} 1\,dydx\\ &=\int_0^\infty\int_{|f|^{-1}(y)}^\infty 1\,dxdy\qquad\text{(Fubini Theorem)}\\ &=\int_0^\infty\lambda\{x:x>|f|^{-1}(y)\}dy\\ &=\int_0^\infty\lambda(E_y)dy. \end{align*}
However, it was considered only when $n=1$. I want to know more precise answer in $R^n$ for the first question.
Note that, for every $x$, $$ |f(x)|^p=\int_0^{|f(x)|}pt^{p-1}\mathrm dt=\int_0^{+\infty}\mathbf 1_{t\lt |f(x)|}u(t)\mathrm dt=\int_0^{+\infty}\mathbf 1_{x\in E_t}u(t)\mathrm dt, $$ where $u(t)=pt^{p-1}$ hence $u\geqslant0$. Integrate this with respect to a sigma-finite measure $\lambda$ on the measured space $E$ the function $f$ is defined on and use (Tonelli-)Fubini theorem to exchange the integration signs. This yields $$ \|f\|_p^p=\int_E|f(x)|^p\lambda(\mathrm dx)=\int_E\int_0^{+\infty}\mathbf 1_{x\in E_t}u(t)\mathrm dt\lambda(\mathrm dx), $$ hence $$ \|f\|_p^p=\int_0^{+\infty}\left(\int_E\mathbf 1_{x\in E_t}\lambda(\mathrm dx)\right)u(t)\mathrm dt, $$ and note that each inner integral in the RHS is $\lambda(E_t)$.