Changing value of a Riemann integrable function on a Lebesgue measure 0 set implies the new function has the same Riemann integral

definite integralsintegrationreal-analysisriemann-integration

Suppose $[a,b]$ is a compact interval of $\mathbb{R}$ and $f:[a,b]\to\mathbb{R}$ be integrable in the Riemann sense. Then, by Lebesgue's criterion, $f$ is bounded on $[a,b]$ and it's set of discontinuities has Lebesgue measure zero.

Now suppose $\tilde{f}:[a,b]\to\mathbb{R}$ is a new function built by changing the value of $f$ in a Lebesgue measure zero subset of $[a,b]$. Since $\tilde{f}$ remains bounded and it's set of discontinuities has still Lebesgue measure zero, we know that $\tilde{f}$ is Riemann integrable.

Is it true that $$\int_{a}^{b}f=\int_{a}^{b}\tilde{f}\qquad ?$$

Best Answer

Let $f=0$ and $g(x)=0$ for $x$ irrational, $1$ for $x$ rational. Then $f$ is Riemann integrable, $f=g$ almost everywhere but $g$ is discontinuous everywhere, is it is not Riemann integrable.