# bounded function continuous except for a set of measure zero

Let $f$ be a bounded real function on $\mathbb{R}^n$ and $P$ be a subset of $\mathbb{R}^n$ with Lebesgue measure zero. If $f$ is continuous on $P^c$, then $f$ is Riemann integrable.

Is it true?

my idea: since $\lambda(P)=0$, for any $\epsilon>0$ there exists cubes $I_1,\cdots, I_n$ such that $P\subseteq \cup _{k=1}^nI_k$, $\sum_{k=1}^n \lambda(I_k)<\epsilon$. Suppose $|f|<M$. Then for any partition $\sigma$ of $P$, the Riemann upper sum of $\sigma$ and Riemann lower sum of $\sigma$ differs at most $2M\epsilon$. Since $f$ is continuous on $P^c$, it is Riemann integrable. Is the argument valid?

The idea seems correct, just in your problem I believe the domain of the function $f$ should be a compact box instead of $\mathbb{R}^n$, since
1. "$P\subset \cup_{k=1}^n I_k$" might not hold if the domain of $f$ is not compact. As a counter example, take $P = \mathbb{Q}$, you need countable union of open intervals to cover it.