I would love some help with this problem:
Let $(X,\mathcal F,\mu)$ be a measurable space and let $f:X\to[0,\infty)$ be a positive Lebesgue integrable function. Prove that $$\int_X fd\mu = \int_0^\infty \mu(\{x\in X : f(x) > \lambda\})d\lambda.$$
I understand why this works geometrically in two dimensions but am not really sure how to go about showing this formally. I believe a good method would be to show the equality for step functions and then somehow generalize, but I'm not sure exactly how to do this either.
I'd appreciate any help.
Thanks!