Let $f : [0,1] \to \R$ be defined as follows: \[ f(x) = \begin{cases} 0 & \text{ if } x \notin \Q \\ 1 & \text{ if } x = 0 \\ \frac1q & \text{ if } x = \frac{p}{q} \text{ with } p \in \Z, q \in \N, \text{ and } p, q \text{ have no common factor}.\end{cases}\] (For example, $f(0) = f(1) = 1$, $f(1/2) = 1/2$, $f(1/4) = f(3/4) = 1/4$.)
Prove that $f$ is integrable, and find its integral.
Suppose that $f : [0, 1] \times [0, 1] \to \R$ is continuous. Notice that for each $y_0 \in [0, 1]$, we have a function \begin{align*} [0, 1] &\longrightarrow \R \\ x &\longmapsto f(x, y_0). \end{align*} Each of these functions is continuous, and so integrable; this can be checked directly from the definition, or by using the sequential characterisation of continuity.
Here are some further problems to think about out of interest. You do not need to attempt them, nor should you submit them with the assignment.
Let $f : [0, 1]\times[0, 1] \to \R$.