let $f : [0,1]^2\rightarrow \mathbb{R}$ be defined by setting $f(x, y) = 0$ if $y \neq x$, and $f(x, y) = 1$ if $y = x$. Show that $f$ is integrable You have tried the following way: Give $\varepsilon>0$,  Take any partition P, $0=t_0<t_1<...<t_n=1$ of $[0,1]$ so $U(P,f)-L(P,f)=\sum_{i=1}^{n}(M_i-m_i)\Delta t_i$ And like  $M_i=1$ for any $i$ an $m_i=0$ for any $i$ then $U(P,f)-L(P,f)=\sum_{i=1}^{n}\Delta t_i$, so $U(P,f)-L(P,f)=1-0<\varepsilon$, Is it well?

Consider a tagged partition $P \equiv x_{i,j}= (\frac{i}{n},\frac{j}{n})$ with $0 \le i \le n$ and $0 \le j \le n$ where $n \in \mathbb N$ and $t_{i,j} \in (x_{i,j},x_{i+1,j}) \times (x_{i+1,j},x_{i+1,j+1})$ for $0 \le i \le n-1$ and $0 \le j \le n-1$.
Then you can prove that
$$0 \le \sum_{0 \le i \le n-1, 0 \le j \le n-1} f(t_{i,j})(x_{i+1,j}-x_{i,j})(x_{i,j+1}-x_{i,j}) \le \frac{1}{n}$$ by considering the cases where $i = j$ or $i \neq j$.
Based on that, you can conclude that $f$ is Riemann integrable.
