The following is a favorite of mine (due to the fact that it nicely demonstrates the workings of Funbini's theorem); I can't currently remember where I fished it from, but it's likely it was one of Rudin's textbooks: $f:[0,1]^2\to[0,1]$ defined
$$f(x,y) = \begin{cases}1 & x\not\in\mathbb{Q}\vee y\not\in\mathbb{Q}\\
1-\frac{1}{q} & x,y\in\mathbb{Q}, x=\frac{p}{q}, \gcd(p,q)=1\end{cases}$$
Naturally, it's not different from your original suggestion (nor can it be, due to Lebesgue's integrability theorem).