I'm reaching out because I'm genuinely stuck on a few questions from a homework assignment for my measure theory class. Despite spending the last couple of days trying to work through them, I keep hitting dead ends. Any assistance or pointers you could offer would be incredibly valuable. Here's one of the questions:
Let $f:\mathbb{R} \to \mathbb{R}$ be a lebesgue measurable function. Prove that $$\int_{\mathbb{R}} |f(x)|dm(x) = \int_{0}^{\infty} m\left( \left\{x \in \mathbb{R} \mid |f(x)| \geq t \right\} \right) dm(t)$$
Note, this assignment has been given to us after we were introduced in the lecture to product spaces, and among the rest to Fubini's/Tonelli's theorems.
Edit - My proof attempt I aim to to use Fubini's/Tonelli's theorem. By rewriting the left-hand side integral as $$ \int_{\mathbb{R}} |f(x)|dm(x) = \int_{\mathbb{R}} \left( \int_{0}^{|f(x)|} 1dm(t)\right)dm(x) $$ If I could use any of the mentioned theorems then by changing the order of integration I would get$$\int_{0}^{\infty} \left(\int_{\mathbb{R}} \mathbb{1}_\left\{\left(x,t\right) \mid 0\leq t\leq |f(x)| \right\} dm(t)\right)dm(x) = \int_{0}^{\infty} m\left( \left\{ x\in \mathbb{R} \mid|f(x)| \geq t \right\} \right)dm(t)$$ but I don't know how to justify the use of any of them.