The Lebesgue criterion for Riemann-integrability of a function $f \colon \mathcal{D} \subseteq \mathbb{R} \longrightarrow \mathbb{R}$ states that a function is Riemann-integrable in a compact $\mathcal{D}$ when the set of discontinuities of $f$ in $\mathcal{D}$ has Lebesgue measure $0$.
I'm not sure I fully understand this, maybe because I haven't yet seen a rigorous prove of it, and here's why: the Dirichlet function
$$1_\mathbb{Q}(x) = \left\{\array{1 & x\in\mathbb{Q} \\ 0 & x \notin\mathbb{Q}}\right.$$
is continuous nowhere, but it would be continuous if a $0$-Lebesgue measure changed (if the function evaluated at the rationals was also $0$). This function is not Riemann-integrable in any compact subset of $\mathcal{D}$, though, so... why?
Maybe it's because this function is continuous nowhere, and not continuous "everywhere but in a $0$-measure set", but is it even possible to have a function continuous at the irrationals and not continuous at the rationals?, and would such a function be Riemann-integrable?