Why $f(x)$ is Riemann integrable? If somebody can explain to me why the following function is Riemann Integrable on $[0,1]$ and how to find $\int_0^1 f(x)~dx$
$$f(x)= \begin{cases}1 &\text{ if }  x=0\\
0 &\text{ if } x \in [0,1] \setminus \Bbb{Q}, \\
\frac 1n &\text{ if } x=\frac mn \in [0,1] \cap \Bbb{Q} \text{ with } \gcd(n,m)=1\end{cases}
$$

For a slightly more high-powered answer, this function is continuous everywhere except the rationals, so it meets the Lebesgue criterion for Riemann integrability: A bounded function on a compact interval is Riemann integrable if and only if it is continuous except on a set of measure zero.
