Question about integration in $\mathbb{R}^n$ Let $Q \subseteq \mathbb{R}^n$ be a box, $f:Q \to \mathbb{R}$ integrable on $Q$. Also, say $g: Q \to \mathbb{R}$ is bounded and $f(x) = g(x) $ for all $x \in Q - E $ where $E$ is closed set and has measure zero . Then must $g$ be integrable over $Q$ and $\int_Q f = \int_Q g $ ?
 A: Since $f = g$ on $Q - E$ where $E$ is closed and has measure zero, we can assume $Q$ is open (neglecting the boundary of the box) and then $Q - E$ is open so $Q - E$ is a union of countably many open balls. The discontinuities of $g$ can occur either in the open balls that make up $Q - E$, or in $E$. However any discontinuity of $g$ in $Q - E$ must be a discontinuity of $f$ since it occurs in an open ball in $Q - E$, and $g = f$ in $Q - E$. Since $f$ is integrable, these discontinuities have measure zero. Also $E$ has measure zero, so the discontinuities of $g$ have measure zero. This is enough to show $g$ is integrable, and since $g = f$ everywhere except on a measure zero set, the integral of $g$ is equal to the integral of $f$.
A: Let $\epsilon >0$. Say $| g(x) | \leq M $ for all $x \in Q$. Since $E$ is closed, then it must be compact. Hence, since $E$ has measure zero, we can select rectangles $\widetilde{Q_i} $ for $i=1,...,k$ such that they cover $E$ and $\sum_{i=1}^k Vol( \widetilde{Q_i} ) < \frac{ \epsilon }{2M}$. Since $f$ is integrable over $Q$, then we can take a partition $P$ of $Q$ such that $U(f,P) - L(f,P) < \frac{\epsilon}{2} $. We refine $P$ by adding the points of the component intervals of the $\widetilde{Q_i}'s$ to the partition $P$, and we call $P'$ this new partition. Hence,
$$ U(g,P') = \sum_{R \subseteq Q} M_R(g) Vol(R) = \sum_{R \subseteq Q \setminus E} M_R(f) Vol(R) + \sum_{ \widetilde{Q_i} \subseteq R } M_{\widetilde{Q_i}} (g) Vol( \widetilde{Q_i} ) \leq $$
$$ \leq U(f,P') + \frac{\epsilon}{2M} \cdot M \leq U(f,P) + \frac{ \epsilon}{2} $$
Similarly,
$$ L(g,P') = \sum_{R \subseteq Q \setminus E } m_R(f) Vol(R) + \sum_{ \widetilde{Q_i} \subseteq R } m_{\widetilde{Q_i}} (g) Vol( \widetilde{Q_i} ) \geq $$
$$ \sum_{R \subseteq Q} m_R(f) Vol(R) = L(f,P') \geq L(f,P) $$
Hence,
$$ U(g,P') - L(g,P') \leq U(f,P) + \frac{\epsilon}{2} - L(f,P) < \frac{ \epsilon}{2} + \frac{\epsilon}{2} = \epsilon $$
So, $g$ is integrable over $Q$. Now, since $U(g,P') \leq U(f,P) $, then we have that $U(g,P') \leq \inf_{P} \{ U(f,P) \} \implies U(g,P') \leq \int_Q f \implies \int_Q g \leq \int_Q f$. Similarly, since $L(g, P') \geq L(f,P)$, then we must have that $L(g,P') \geq \sup_P \{ L(f,P) \} = \int_Q f \implies \int_Q g \geq \int_Q f$ and so 
$$ \int\limits_Q f = \int\limits_Q g $$
