Riemann integrable
A bounded function is Riemann integrable when the over-estimating staircase and the under-estimating staircase can be squeezed together to agree on a single number. Intuitively, the function is tame enough that the area beneath it is unambiguous: no matter how generously or stingily you approximate, refining enough collapses both estimates onto the same value.
Precisely, a bounded function f on [a, b] is Riemann integrable if its lower integral equals its upper integral. The shared value is then written as the integral of f from a to b. Equivalently, by the Darboux–Riemann equivalence, the tagged Riemann sums converge to this number as the mesh tends to zero, independent of how tags are chosen.
Many familiar classes are integrable: every continuous function on [a, b], every monotone function, and any bounded function with only finitely many discontinuities. But not all bounded functions qualify — the Dirichlet function (rationals to 1, irrationals to 0) has lower integral 0 and upper integral 1, so it is not Riemann integrable. The exact dividing line is given by the Lebesgue criterion: integrability holds iff the discontinuities form a set of measure zero.
The Thomae function (1/q at rational p/q in lowest terms, 0 at irrationals) is Riemann integrable on [0, 1] with integral 0, even though it is discontinuous at every rational — its discontinuity set is countable, hence of measure zero.
Infinitely many discontinuities are fine, as long as they have measure zero.
Riemann integrability is strictly weaker than Lebesgue integrability for bounded functions on bounded intervals: every Riemann integrable function is Lebesgue integrable with the same value, but the converse fails (the Dirichlet function is Lebesgue integrable, with integral 0).