Let $\mathcal{L}$ be the Lebesgue measure on $Y=[0,\infty)$. Let $(X,\mathfrak{B},\mu)$ be a $\sigma$-finite measure space and let $f$ be a nonnegative $\mu$-measurable function on $X$. Prove that $\int_X f \, d\mu=\int_Y\mu(f^{-1}[t,\infty)) \, d\mathcal{L}(t)$.
I'm learning measure theory and is this question correct? Because I get $\int_X f \, d\mu=\int_Y\mu(f^{-1}[t,\infty)) \, d\mathcal{L}(t)=\mu(f^{-1}[t,\infty))\mathcal{L}([0,\infty))=\infty$ and this is not true when $X$ has finite measure and $f$ is bounded. Thanks for your helps.
Hint: $$ \int f(x)dx =\int \left [\int 1_{0 < f(x) < y} dy \right]dx $$Now use the Fubini theorem.