Proof (Necessity of Lebesgue's criterion for Riemann integrability)
Note that $$ \begin{align*} D = \sb{x\in[a,b]}{\omega_f(x) > 0}. \end{align*} $$ Let $N(\alpha) = \sb{x\in[a,b]}{\omega_f(x) \geq \alpha}$. Then $$ \begin{align*} D = \bigcup_{k=1}^\infty N\left(\frac{1}{k}\right) \end{align*} $$ so it is sufficient to show that $N(\alpha)$ has measure zero.
Suppose $f:[a,b]\to\R$ is integrable. Fix $\epsilon>0$, then there is a dissection $\mathcal{D}$ such that $$ \begin{align*} U(f,\mathcal{D}) - L(f,\mathcal{D}) = \sum_{j=1}^{\infty} (x_j - x_{j-1}) \omega_f([x_{j-1}, x_j]) < \frac{\alpha\epsilon}{2}. \end{align*} $$ Let $F = \sb{j}{(x_{j-1}, x_j)\cap N(\alpha) \neq \emptyset}$. For each $j\in F$, $\omega_f([x_{j-1}, x_j]) \geq \alpha$, so $$ \begin{align*} \frac{\alpha\epsilon}{2} > \sum_{j\in F} (x_j-x_{j-1})\omega_f([x_{j-1}, x_j]) \geq \alpha \sum_{j\in F} (x_j - x_{j-1}) \implies \sum_{j\in F} (x_j - x_{j-1}) > \frac{\epsilon}{2}. \end{align*} $$
So these cover $N(\alpha)$ except for possibly $x_0, \ldots, x_n$, which can be convered by a finite number of intervals of total length $\epsilon/2$. Hence $N(\alpha)$ has measure zero, so $D$ has measure zero.