Sketch: we can confine all but finitely many discontinuities of $f$ into a small interval $I$. Outside $I$, we can choose a partition fine enough to make the upper and lower sums arbitrarily close. Simultaneously, since $f$ is bounded, we can choose $I$ small enough that it cannot contribute too much to the difference between the lower and upper sums.
Details:
Since $f$ is bounded above and below, we can subtract off the lower bound in order to assume without loss of generality that $f \geq 0$. Having done so, choose $M$ such that $f \leq M$.
Let $\varepsilon > 0$. Choose $N$ large enough that $M/N<\varepsilon/2$. Choose a partition $P$ of $[1/N,2]$ whose mesh is small enough that the lower and upper sums for $P$ differ by at most $\varepsilon/2$. (Here I assume we have already proven that a function with finitely many discontinuities is Riemann integrable.)
Now extend $P$ to a partition $P'$ of $[0,2]$ by adding in the points $0$ and $1/N$. The difference between the lower and upper sums on $[1/N,2]$ is still at most $\varepsilon/2$, while the difference between the lower and upper sums on $[0,1/N]$ is also at most $\varepsilon/2$, since $0 \leq f \leq M$ there. So the difference between the lower and upper sums for $P'$ is at most $\varepsilon$.
We can tweak this to look much like the proof of the Lebesgue criterion. Set up the same as above, but where $M/N<\varepsilon/3$ instead. Take $\delta>0$ small enough that $MN\delta<\varepsilon/3$. Take intervals of length at most $\delta$ around $1,1/2,\dots,1/N$ in your partition. Then refine the rest of the partition enough that the difference between the upper and lower sums is less than $\varepsilon/3$ there (which we can do because $f$ is continuous there). Then again the lower and upper sums for the overall partition is at most $\varepsilon$ ($\varepsilon/3$ from the small intervals near the "widely spaced" discontinuities, $\varepsilon/3$ from the small interval containing the "tightly packed" discontinuities, and $\varepsilon/3$ from the continuous part).
Here I add in the assumption that $f$ is bounded, because unbounded functions are never Riemann integrable (since there is always a subinterval of the partition where the upper or lower sum is infinite).
We can use the following:
Lemma. If $f$ is continuous on $[a,b]$ then for any $\epsilon > 0$ there exists $\delta > 0$ such that for any partition $P$ of $[a,b]$ with $\|P\| < \delta$ and any refinement $R$ of $P$, we have $|S(f,P) - S(f,R)| < \epsilon$.
Applying the lemma, we can show that if $f$ is continuous, then the Cauchy criterion is satisfied. That is, for any $\epsilon >0$ there exists $\delta > 0$ such that if $P$ and $Q$ are any partitions satisfying $\|P\|, \|Q\| < \delta$, then $|S(f,P) - S(f,Q)| < \epsilon.$
To see this, let $R = P \cup Q$ be a common refinement and take $\delta$ as specified in the lemma such that if $\|P\|, \|Q\| < \delta$, we have $|S(f,P) - S(f,R)| < \epsilon/2$ and $|S(f,Q) - S(f,R)| < \epsilon/2$. Whence, it follows that
$$|S(f,P) - S(f,Q)| \leqslant |S(f,P) - S(f,R)| + |S(f,Q) - S(f,R)| < \epsilon/2 + \epsilon/2 = \epsilon.$$
It remains to prove the lemma.
Since $[a,b]$ is compact, $f$ is uniformly continuous and for any $\epsilon > 0$ there exists $\delta >0$ such that if $|x - y| < \delta$, then $|f(x) - f(y)| < \epsilon/(b-a)$. Suppose $\|P\| < \delta$ and $R$ is a refinement of $P$. Any subinterval $[x_{j-1}, x_{j}]$ of $P$ can be decomposed as the union of subintervals of $R$,
$$[x_{j-1},x_{j}] = \bigcup_{k=1}^{n_j}[y_{j,k-1}, y_{j,k}],$$
and
$$\begin{align}\left|S(f,P) - S(f,R)\right| &= \left|\sum_{j=1}^n f(\xi_j)(x_j - x_{j-1}) - \sum_{j=1}^n \sum_{k=1}^{n_j}f(\eta_{j,k})(y_{j,k} - y_{j,k-1})\right| \\ &\leqslant \sum_{j=1}^n \sum_{k=1}^{n_j}|f(\xi_j) - f(\eta_{j,k})|(y_{j,k} - y_{j,k-1}) \\ &\leqslant \sum_{j=1}^n \sum_{k=1}^{n_j}\frac{\epsilon}{b-a}(y_{j,k} - y_{j,k-1}) \\ &= \epsilon\end{align}$$
Best Answer
Since the function is continuous nowhere, the Lebesgue measure of the discontinuous points say on $[0,1]$ is 1, and since this Lebesgue measure is nonzero, and noting also that the theorem is an i.f.f., we know that the function is not Riemann integrable on $[0,1]$.
A different function, named Thomae's function, which is continuous at all irrationals and discontinous at at rationals, and hence discontinuous on a set of measure 0, is in fact integrable (see link).
The fact that you can change a 0-Lebesgue measure is not relevant to the use of the Lebesgue criterion, because it changes the function fundamentally. In fact something like Lusin's Theorem shows that it can be always done in an $\epsilon$ set. (Although I am sweeping quite a lot of details under the rug, like relative topology, etc.) See https://en.wikipedia.org/wiki/Lusin%27s_theorem for details.