# Is this proof correct? (Showing that if $f$ is zero except on a closed set $E$ of null measure then $f$ is integrable

Let $E \subset I\times I$, where $I = [0,1]$, and suppose that $E$ has null measure and is closed. Then I want to prove that a bounded function $f : I\times I \to \mathbb{R}$ that is null except on $E$ is $\textbf{Riemann}$ integrable and its integral equals $0$. I proceeded as follows:

Take $\epsilon > 0$ and let $\{Q_i\}$ one cover by closed rectangles such that $E$ is contained on the union of the interiors of $Q_i$. Then once $E$ is compact I can take this cover finite. Let $P$ the following partition:

$R$ is a sub-rectangle of such partition if $R$ is included in one of the two cases:

$\mathcal{S_1} : R \in P$ and $R \subset Q_i$ for some $i$;

$\mathcal{S_2} : R \in P$ and $R \cap E = \emptyset$.

Then $$S(f,P) - s(f,P) = \sum_{R \in \mathcal{S_1}} (M_R - m_r)v(R) + \sum_{R \in \mathcal{S_2}}(M_R - m_R)v(R).$$

The second sum is entirely null, once on $R \in \mathcal{R_2}$ the function is constant equals $0$.

Then, $$S(f,P) - s(f,P) = \sum_{R \in \mathcal{S_1}} (M_R - m_r)v(R).$$

Let's choose $M = \max_{R \in \mathcal{S_1}} (M_R - m_R).$

Then $S(f,P) - s(f,P) \le M\sum_{R \in \mathcal{S_1}}v(R) < M\epsilon.$

Then if $M = 0$ then we are done. Otherwise, $M\neq 0$, then I could have choose $\{Q_i\}$ such that $\sum_{R \in \mathcal{S_1}}v(R) <\epsilon/M.$

Then $f$ is integrable by the Riemann criterium.

To show that its integral equals zero take any partition. Then any rectangle $R$ of partition is not contained on $E$ (Since any rectangle has non null measure). The $f$ vanishes on some point of $E$. Then $m_R(f) \le 0$ and $M_R(f) \ge 0.$ The the lower integral is less than zero and the upper integral greater than $0$. Once $f$ is integrable them have to coincide, then the integral equals $0$.

Is this correct?

The proof that $f$ is integrable is basically correct. You just need to be more precise about the existence and construction of partition $P.$
Since $E$ is compact and of measure $0$, for any $\epsilon > 0$ there exists a finite collection of open rectangles $\{Q_1, Q_2, \ldots, Q_n \},$ such that
$$E \subset \bigcup_{i=1}^n Q_i, \\ \sum_{i=1}^n v(Q_i) < \epsilon.$$ Let $\bar{Q_i}$ be the closure of $Q_i$ and WLOG we can assume that no two $\bar{Q_i}$ overlap. The set
$$F = [0,1]^2 \setminus \bigcup_{i=1}^n Q_i,$$
is compact and can be covered by non-overlapping closed rectangles $\{R_1, R_2, \ldots, R_m \},$ such that $f(x) = 0$ for $x \in R_i \subset [0,1]^2$.
Now form the partition $P$ which is the union of the two sets of closed rectangles and the remainder of your argument is correct.