Let $f:[0,1]\times[0,1]\to \mathbb R$, $$f(x,y)= \begin{cases} \frac1q+\frac1n, & \text{if $(x,y)=(\frac mn,\frac pq) \in \Bbb Q\times\Bbb Q,$ $ (m,n)=1=(p,q)$ } \\ 0, & \text{if $x$ or $y$ irrational$ $ or $0,1$} \end{cases} $$
Prove that f is integrable over $R=[0,1]\times[0,1]$ and find the value of the integral (I know its value is zero, because every lower sum is zero).
I'm trying to find the set of discontinuities of $f$ over $R$ and prove that it has measure zero, so that $f$ is integrable.
I remember doing this for the one dimensional case (Thomae´s function), proving that $f$ was continuous over the irrationals and discontinuous over the rationals, but I can't prove it this time, so I need some help, it will be really appreciated.
Let $u\mapsto T(u)$ $\>(0\leq u\leq1)$ be Thomae's function. Then $$0\leq f(x,y)\leq T(x)+T(y)\qquad\bigl((x,y)\in Q:=[0,1]^2\bigr)\ .$$ By "Fubini's theorem" for Riemann integrals one obtains $$\int_Q T(y)\>{\rm d}(x,y)=\int_0^1 \int_0^1 T(y) dy\ dx=0\ ,$$ and similarly for $(x,y)\mapsto T(x)$. It follows that $\int_Q f(x,y)\>{\rm d}(x,y)=0$.