In the text I'm working through, the Lebesgue integral is related to the Riemann integral as follows:
For some non-negative, real valued function $f$ on $\Bbb{R}$, set $E_y=\{x:f(x)>y\}$ and $g(y)=m(E_y)$. Then $\int f=\int_0^\infty g(y)dy$. I understand that $g$ is non-decreasing but it also says that $g$ has only a countable number of discontinuities (so it is Riemann integrable). I mean, it makes sense why that would be true but how would you prove that there are only a countable number of discontinuities?
Also it kind of glosses over how you use Fubini's theorem to show $\int f=\int_0^\infty g(y)dy$, so any hints there would also be nice!
Any monotone function can have only countably many discontinuities: If $x$ is a point of discontinuity, there must exist a rational number $r$ such that $$f(x-) < r < f(x+)$$ where $f(x-0$ and $f(x+)$ are the left- and right-hand limits at $x$, respectively.
To see the integral result, we have \begin{align*} \int_0^{\infty} g(y) dy &= \int_0^{\infty} m(E_y) dy \\ &= \int_0^{\infty} \int_{-\infty}^{\infty} \chi_{E_y}(t) dt dy \\ &= \int_{-\infty}^{\infty} \int_0^{\infty} \chi_{E_y}(t) dy dt \\ \end{align*} since the integrand is everywhere non-negative, and $\chi_{E_y}(t)$ is the indicator function $E_y$. Now for each fixed $y$, $\chi_{E_y}(t) = 1$ if and only if $t \in E_y$, if and only if $y < f(t)$. Therefore,
$$\int_0^{\infty} \chi_{E_y}(t) dy = \int_0^{f(t)} dy = f(t)$$
and the result follows.