Let $ f $ defined at $ [0,1] $ by
$$f(x)=\frac{1}{p+q}\; \;\text{if }x=\frac pq \; \text{with }\; \gcd(p,q)=1$$ and $$f(x)=0 \; \;\text{if }\; x=0\; \text{or} \;x\notin \Bbb Q$$
I want to prove that $ f$ is Riemann integrable at $ [0,1] \;$ and compute $$\int_0^1f(x)dx$$
They told me to consider the set $$E_n=\left\{x\in \Bbb Q\cap [0,1]\;\;:\;f(x)\ge \frac 1n\right\} $$ and the function $ \psi $ defined by
$$\psi(x)=\epsilon \; \text{if} \;x\notin E_n$$ and $$\psi(x)=f(x)\; \text{if} \; x\in E_n.$$
I tried to construct two step functions to satisfy the definition of Riemann integrability but i don't see how to use the help given. Thanks in advance.
I claim two things:
(i) $f$ is continuous at every irrational point in $[0,1]$ ;
(ii) $\int_0^1 f = 0$.
Notice that claim (i) tell us that $f$ is indeed (Riemann) integrable on $[0,1]$ by the Lebesgue Criterion for Riemann Integrability, beacuse $\mathbb{Q}\cap [0,1]$ has measure zero.
Try proving these claims, by first looking at Thomae's Function, which is very similarly defined. (Claims (i) and (ii) also hold for Thomae's function. Can you modify the proofs to work for your function?)