how to check and solve the following riemann integral if function is integrable? let 
$$f(x)= \begin{cases}
 x^2  \text{ if $x$ is rational}\\ 
  0 \text{ if $x$ is irrational}
\end{cases}
$$
  let 
$$g(x)=\begin{cases}
 \frac{1}{q}  \text{ if $x=\frac{p}{q}$ where $(p,q)=1$}\\
              0   \text{ if $x$ is irrational}
\end{cases}
$$
Then which of the following holds?
a)  $g$ is Riemann integrable but not $f$
b) both $f$ and $g$ Riemann integrable.  
c) Riemann integral of $f$ is $0$
d) Riemann integral of $g$ is $0$

Since $f$ is discontinuous at every point, it follows that its set of discontinuities has a Lebesgue measure $>0$ and so $f$ is not Riemann integrable. 
For $g$, note that it is the so called Tomae's function, for which you can see here that it is continuous at all irrational numbers and discontinuous at all rationals. Therefore its set of discontinuities is with Lebesgue measure zero and thus it is Riemann integrable. Also its Riemann integral is $0$ (see here)
So (a) and (d)
