Prove that $f$ is Riemann integrable

Let $A\subseteq\mathbb R^n$ be a box, let $f: A\to \mathbb R$ be a bounded function.

Suppose there exists a set $B \subseteq A$ such that $B$ is Riemann measurable and has volume zero, such that $f$ is continuous on $A\setminus B$.

Then $f$ is Riemann integrable.

I understand this, but I can't find a formal proof of it.

I know how I would prove that if $A\subseteq \mathbb R^n$ was a Riemann measurable set then every continuous bounded function $f:A \to R$ is Riemann integratable.

Is there a way to adapt this proof?

• This is a weaker version of the famous "Lebesgue criterion for Riemann integrability", which says that a bounded function $f$ on a box is Riemann integrable if and only if its set of discontinuities has Lebesgue measure zero. The proof should be similar, but a bit messier, in this setting. (The idea of the proof is to cover the set of discontinuities by an open set of small volume, partition the complement as usual, and then use the boundedness to control the size of the integral on the cover). – Ian Feb 3 '17 at 16:29
• Thank you! May I ask a few more questions? Can I assume $A$ is Riemann Measurable because it is a box itself or because it's subset $B$ is Riemann measurable? Is there a way to prove $f$ is continuous using $B$? Thank you again for your help! – user377174 Feb 6 '17 at 17:57
• $A$ is Riemann measurable because it is a box; having a Riemann measurable subset does not make a set Riemann measurable by default. I don't know what you mean about proving $f$ is continuous; $f$ should not be continuous. The point is to come up with a condition that ensures $f$ is Riemann integrable when $f$ is not continuous, and indeed not continuous on a relatively large set. (For example, the indicator function of the ternary Cantor set is Riemann integrable.) – Ian Feb 6 '17 at 18:15
• Ah, I see, so can I take $B$ to be the set of discontinuities? – user377174 Feb 6 '17 at 18:19
• The statement does not require $B$ to be the set of discontinuities, but yes, if the set of discontinuities is Riemann measurable with volume zero then $f$ is Riemann integrable. – Ian Feb 6 '17 at 19:27