Show $f$ in Riemann integrable Let 
$\displaystyle f(x)=\begin{cases}
\frac{1}{n}, & \text{if }x=\frac{m}{n},m,n\in\mathbb{N}\text{ and m and n has no common divisor} \\
0, & \text{otherwise}
\end{cases}$
Show $f\in R[0,1]$.
How to find a partition $P_\epsilon$ such that $U(P_\epsilon,f)-L(P_\epsilon,f)<\epsilon$ for all $\epsilon>0$?
$L(P_\epsilon,f)=0$, so only need to consider $U(P_\epsilon,f)$.
 A: Hint. A bounded function $f:[a,b]\to\mathbb R$ is Riemann integrable iff for every $\varepsilon>0$, here exists a partition $P$ of $[a,b]$, such that
$$
U(f,P)-L(f,P)<\varepsilon.
$$ 
In the case of this function $L(f,P)=0$, for all $P$ of $[0,1]$.
Given an $\varepsilon>0$, we simply need to find a partition $P$ of $[0,1]$ for which $U(f,P)<\varepsilon$.
Clearly, there are only finitely many points $\{x_k\}$ in $[0,1]$, where
$$
f(x_k)>\frac{\varepsilon}{2}.
$$
Say $N=N(\varepsilon)$ such point. Simply take a partition, where all these $x_k$'s lie in very small subintervals $[t_{k_1},t_{k_2}]$, i.e.,
$$
t_{k_1}=x_k-\delta<x_k<x_k+\delta=t_{k_2},
$$
with $\delta<\varepsilon/2N$. 
Then check that for this partition $U(f,P)<\varepsilon$.
A: You can avoid using any partition. Show that $f$ is continuous at the irrationals and discontinuous at all the rationals. Then $f$ is a function with countable number of discontinuities and hence is Riemann Integrable see this   Proof that a function with a countable set of discontinuities is Riemann integrable without the notion of measure.
A: Take the intervals between the points in $\frac{1}{n!}ℤ ∩ [0..1]$. Any rational between $\frac{k}{n!}$ and $\frac{k+1}{n!}$ for any $k ∈ ℤ$ must have denominator greater than $n$ (you can expand any fraction with denominater $n$ or less to a fraction with denominator $n!$, so any such fraction is already in $\frac{1}{n!}ℤ$). This means that in each open interval between points in $\frac{1}{n!}ℤ∩[0..1]$, $\sup f$ is less than $1/n$.
