Thomae's function is defined by $f(x):={1\over q}$ when $x={p\over q}$ in lowest terms, and $f(x):=0$ otherwise, i.e., if $x$ is irrational.
Claim: This $f$ is Riemann integrable over $[0,1]$, and $\int_0^1 f(x)\>dx=0$.
Proof: Let an $\epsilon>0$ be given. There is an $n\in{\mathbb N}$ with ${1\over n}<\epsilon$. The points $x\in[0,1]$ with $f(x)\geq\epsilon$ have denominator $<n$. There are at most
$$2+\sum_{k=2}^{n-1}(k-1)\leq {n^2\over2}$$
such "bad" points. Consider now the partition ${\cal P}_N$ of $[0,1]$ into $N>{n^2\over\epsilon}$ equal parts of width $h:={1\over N}$. At most $n^2$ of the subintervals can contain a "bad" point $x$, and in any case $f(x)\leq1$ there. There are less than $N$ "good" intervals, and $f(x)<\epsilon$ for all $x$ in a "good" interval. It follows that
$$0=L(f,{\cal P}_N)<U(f,{\cal P}_N)<n^2\cdot1\cdot\>h +N\cdot\epsilon\cdot h={n^2\over N}+\epsilon<2\epsilon\ .\tag{1}$$
As $\epsilon>0$ was arbitrary this proves the claim; and $(1)$ then immediately implies $\int_0^1 f(x)\>dx=0$, as well.