Let $B\subseteq\mathbb{R}^{n}$ be a closed generalized rectangle and let $f,g\colon B\to\mathbb{R}$ be two integrable functions. Prove that if $B'=\left\{ x\in B\mid f\left(x\right)\neq g\left(x\right)\right\} $ has measure zero then $\int_{B}f=\int_{B}g$.
My attempt:
$f,g$ are integrable then so is $f-g$ and $f-g=0$ for almost all $x\in B$. Moreover there are generalized rectangles $R_{1},R_{2},\ldots\subseteq B$ where $R_{i}^{int}\cap R_{j}^{int}=\varnothing$ such that $B'\subseteq\bigcup R_{i}$ and $\sum_{i}V\left(R_{i}\right)<\varepsilon$ for any $\varepsilon$.
Now I thought if I could cover $B'$ by a finite number of rectangles in $B$ I could then complete them also by a finite number of rectangles to a partition $\Pi$ of $B$. Then by splitting a Riemann Sum over that partition I think I can finish.
So is there a way to cover $B'$ by a finite number of rectangles?
and/or Is there other way proving this?
EDIT:
Definitions for integrable function:
$f\colon B\to\mathbb{R}$ is integrable if for any $\varepsilon>0$ there is a partition $\Pi=\left\{ B_{1},\ldots,B_{N}\right\} $ of $B$ such that $\sum_{i=1}^{N}V\left(B_{i}\right)\underset{B_{i}}{\text{OSC}}f<\varepsilon$.
OR
$f\colon B\to\mathbb{R}$ is integrable if for any $\varepsilon>0$ there is $\delta>0$ such that for any partition $\Pi=\left\{ B_{1},\ldots,B_{N}\right\} $ of $B$ with $\text{diam}\Pi<\delta$: $\sum_{i=1}^{N}V\left(B_{i}\right)\underset{B_{i}}{\text{OSC}}f<\varepsilon$
Definition for the integral of integrable function:
If $f\colon B\to\mathbb{R}$ is integrable then $\int_{B}f=\sup_{\Pi}\underline{S}\left(f,\Pi\right)$ where $\underline{S}$ is the lower darboux sum
OR
If $f\colon B\to\mathbb{R}$ is integrable then $\int_{B}f=\lim_{\text{diam}\Pi\to0}S\left(f,\Pi,X\right)$ where $S\left(f,\Pi,X\right)$ is a riemann sum
For the Lebesgue integral this follows almost directly from the definition. For the Riemann integral over a rectangle in $\mathbb{R}^n$, the proof is more subtle in order to avoid measure theory -- other than the basic notion of zero measure.
Note that $h = f-g$ is Riemann integrable on $B$ (according to your definitions) and the set
$B' = \{x \in B: h(x) = f(x)-g(x) \neq 0\}$ has measure zero.
Take any partition $P$ of the rectangle $B$. Any subrectangle $R$ of $P$ has non-zero content and measure by definition of a partition. Hence $R$ is not a subset of $B'$ and must contain at least one point where $h(x) = 0$. This implies that $\inf_R h(x) \leqslant 0 \leqslant \sup_R h(x)$.
Forming upper and lower Riemann sums, we have for any partition $P$
$$\underline{S}(h ,P) \leqslant 0 \leqslant \overline{S}(h ,P)$$
Hence,
$$\underline{\int}_{B} h = \sup_P \underline{S}(h,P) \leqslant 0 \leqslant \inf_P \overline{S}(h, P) = \overline{\int}_{B} h $$
Since $h$ is Riemann integrable on $B$, the upper and lower integrals must be equal and
$$\int_{B}f - \int_{B}g =\int_{B}h = \underline{\int}_{B} h = \overline{\int}_{B} h = 0$$