The definition of Thomae function is $$g(x) = \begin{cases} \dfrac{1}{q}, & \text{if $x=\dfrac{p}{q}$} \\[2ex] 0, & \text{if $x$ is irrational} \end{cases}$$ where $p\in \mathbb{Z}, q\in \mathbb{Z}^+$ and $\gcd(p,q)=1.$
I know how to prove $g$ is Riemann integrable on [−1, 1], but how to prove this integral $\int_{-1}^1 g(x)dx$ is 0?
My attempt: for any partition, the smallest Riemann sum is 0, simply because we can always choose representative point to be irrational. But how to complete the proof $\int_{-1}^1 g(x)dx=0$?