A bounded function \(f \colon [a,b] \to \RR\) is Riemann integrable if its upper and lower Darboux integrals, the infimum of the upper sums and the supremum of the lower sums over partitions of \([a,b]\), are equal.
The Lebesgue criterion
Lebesgue criterion for Riemann integrability (Tag PR-TDH2A)
Let \(a<b\) and let \(f\colon[a,b]\to\RR\) be bounded, with set of discontinuities \(D_f\subseteq[a,b]\). Then \(f\) is Riemann integrable on \([a,b]\) if and only if \(D_f\) has Lebesgue measure \(0\).
The Cantor set \(C\) is uncountable and has measure zero, so the bounded function \(\chi_C\) on \([0,1]\), which is discontinuous exactly on \(C\), is Riemann integrable, with integral \(0\).
Consequences
Let \(f\colon[a,b]\to\RR\) be bounded.
If \(f\) is continuous, then \(f\) is Riemann integrable, since \(D_f=\emptyset\).
If \(f\) is monotone, then \(f\) is Riemann integrable, since \(D_f\) is countable and hence null.
If \(f\) has finitely many discontinuities, then \(f\) is Riemann integrable.
A function that is not Riemann integrable
The indicator of $\QQ\cap[0,1]$ is Lebesgue integrable but not Riemann integrable (Tag FE-FJAKV)
Let \(f\coloneqq\chi_{\QQ\cap[0,1]}\colon[0,1]\to\RR\), the Dirichlet function on \([0,1]\).
The set \(\QQ\cap[0,1]\) is countable, hence has Lebesgue measure \(0\), so \(f\) is Lebesgue measurable, \(f = 0\) almost everywhere, and \(\int_{[0,1]} f\,dm = 0\); in particular \(f\) is integrable.
Every subinterval of \([0,1]\) of positive length contains both rational and irrational points, so for every partition \(P\) of \([0,1]\) the upper Darboux sum is \(U(f,P) = 1\) and the lower Darboux sum is \(L(f,P) = 0\). Hence \(f\) is not Riemann integrable.
Relation to the Lebesgue integral
If \(f\colon[a,b]\to\RR\) is Riemann integrable, then \(f\) is Lebesgue integrable on \([a,b]\) and the two integrals are equal.
The converse fails: \(\chi_{\QQ\cap[0,1]}\) is Lebesgue integrable with integral \(0\) and not Riemann integrable.