Prove theorem 13.6 in Analysis on manifolds of Munkres, without assumption about continuity What shown below is a reference from "Analysis on manifolds" by James R. Munkres

First of all I want discuss a point of the proof of the theorem $13.6$. So in the first step Munkres proves that if $f_S$ is continuous at $x_0$ then $f_A$ is continuous at $x_0$ too so that if $D$ and $E$ are the sets of discontinuity points for $f_S$ and $f_A$ then it follows that $E\subseteq D$. Now by the thorem 11.2 we know that $f_A$ is integrable if and only if $E$ has measure zero. So we know that $f_S$ is integrable and so $D$ has measure zero so that $E$ has measure zero too thus $f_A$ is integrable. Now if we want prove that $\int_S f=\int_A f$ we have to prove that $\int_Q f_S=\int_Q f_A$, where $Q$ is a 
 rectangle containing $S$. However it seems to me that the equality $\int_Q f_S=\int_Q f_A$ holds if and only if $E=D$, since we don't know if $f_S-f_A$ vanishes at point in $D\setminus E$. So I ask to discuss better the equality $\int_Q(f_S-f_A)=0$. Then Munkres in an exercise ask to me to show that the the theorem $13.6$ holds without the hypothesis that $f$ is continuous on $S$ so I ask to do this. So could someone help me, please?
 A: Consider the more general case where $\int_S f = \int_Q f_S$ exists but $f$ is not everywhere continuous in $Q$. Let $D_f\subset S$ denote the set of discontinuity points of $f$ in $S$.
With $A = int(S)$, the set $D$ of discontinuity points for $f_S$ is 
$$D = (A \cap D_f) \,\cup\,  (\partial S \cap D_f) \,\cup\, \{x_0 \in \partial S \setminus D_f: \lim_{x \to x_o, x \in A} f(x) \neq 0\} $$
Since $f_S$ is integrable on $Q$ the set $D$ is of measure zero. 
On the other hand, $f_A$ vanishes everywhere on $\partial S$ and $f_A = f_S$ for all $x \in A$.  Hence, the set $E$ of discontinuity points for $f_A$ is
$$E = (A \cap D_f)  \,\cup \, \{x_0 \in \partial S: \lim_{x \to x_o, x \in A} f(x) \neq 0\}$$
Note that 
$$ \{x_0 \in \partial S: \lim_{x \to x_o, x \in A} f(x) \neq 0\} \subset (\partial S \cap D_f) \,\cup\, \{x_0 \in \partial S \setminus D_f: \lim_{x \to x_o, x \in A} f(x) \neq 0\} $$
Hence, $E\subset D$ and $E$ is also of measure zero.
The argument that $\int_S f = \int_A f$ remains the same.  It is irrelevant if $f_S - f_A$ does not vanish at points of $D\setminus E$ since $D\setminus E \subset D$ is of measure zero.
