Consider Thomae's function
{1 if x=0,
t(x)= {1/n if x=m/n∈Q, with m∈Z\{0},n∈N, and gcd(m,n)=1,
{0 if x∉Q.
Prove that t is Riemann integrable on the interval [0,1]. Hint: Set ϵ>0 and let N∈N be large enough so that 1/N<ϵ/2. Define the set DN= {0,1, 1/2, 1/3, 2/3,…, 1/N, 2/N,… N−1/N}. Then, observe that t(x)≥1/N whenever x∈DN, and that t(x)<1/N otherwise. Create a partition P with mesh(P)<ϵ/(2∣DN∣) such that DN ∩P={0,1}.