[Math] show that $g$ is integrable, with $f=g$ except in finite set and $f$ integrable

integrationreal-analysisriemann-integration

Let $f,g:A\subset\mathbb{R}^N\to[0,\infty)$, $f$ is Riemann integrable, and $g=f$ except in finite set, $A$ is a N-dimensional closed cell. Show that $g$ is Riemann integrable and
$\int_Af(x)dx=\int_Ag(x)$

I tried to define $h(x)=g(x)-f(x)$, and prove that the integral exists and is zero.
For that we could maybe use the lebesgue measure $\lambda(D_h)$, of the discontinuities of $h$, but I don't think it works, because if the difference between $g$ and $f$ was infinite and countable, the set would still have measure zero, but $g$ wouldn't be integrable.

Is there another way to prove it?

Best Answer

Let $B$ be the set of all $x \in A$ such that $f(x) \neq g(x)$. Then $B$ is finite by assumption and $B \subset A$. So $B$ has Lebesgue measure $0$. Note that $A = A\setminus B \cup B$; so the measure of $A$ is the measure of $A \setminus B$ plus the measure of $B$, and hence $A = A \setminus B$ in measure. Note that $A \setminus B$ is the set of all $x \in A$ such that $f(x) = g(x)$. Then $\int_{A}f = \int_{A\setminus B} f = \int_{A \setminus B} g = \int_{A}g$.

Note: The Riemann and Lebesgue integration consideration in the question was just made clear after this answer was posted.