Lebesgue criterion for Riemann integrability
When exactly is a bounded function Riemann integrable? The Riemann criterion gives a test in terms of partitions, but Lebesgue's theorem gives a clean structural answer in terms of the function itself: integrability is controlled entirely by how badly the function fails to be continuous. As long as the misbehaving points are negligible in size, the integral exists.
Precisely, a bounded function f on [a, b] is Riemann integrable if and only if the set of points where f is discontinuous has measure zero. A set has measure zero if it can be covered by countably many intervals whose total length is arbitrarily small; finite sets, countable sets, and the Cantor set all qualify, even though the Cantor set is uncountable.
This explains every earlier fact in one stroke: continuous functions (no discontinuities) and monotone functions (at most countably many jumps) are integrable, the Thomae function (discontinuous on the countable rationals) is integrable, and the Dirichlet function (discontinuous everywhere) is not. The notion of measure zero needed here is exactly the seed of Lebesgue's measure theory, which is why this theorem is the natural bridge from the Riemann to the Lebesgue integral.
The characteristic function of the Cantor set is discontinuous exactly on the Cantor set, which is uncountable but has measure zero; hence this function is Riemann integrable on [0, 1], with integral 0.
Even an uncountable discontinuity set is fine, provided it has measure zero — the Cantor set is the showcase example.
Measure zero here is the elementary covering notion, defined before any full theory of Lebesgue measure; one needs no sigma-algebra to state it. The phrase the discontinuities have measure zero is sometimes paraphrased as f is continuous almost everywhere.