$f\in\mathcal{R}[a,b]$ and $f=g$ except at finite (or countably) many points $\implies g\in\mathcal{R}[a,b]$?

Suppose $f\in\mathcal{R}[a,b]$. If I know that $g$ and $f$ are identical everywhere except at some "small" number of points- say $f,g$ are equal everywhere except at countably many points or finitely many points (which I note both have measure zero).

I feel that this is true for both countably many points and for finitely many points because the measure of both these sets is equal to zero, so the differences of the functions shouldn't alter the measure of the discontinuities of $f$, which we know has measure zero for its discontinuities since its Riemann Integrable. I'm trying to show that this is using Lebesgue's criterion for Riemann Integration, so by showing that the measure of the discontinuities of $g$ is equal to $0$. However I don't see how to start with the information I've been given. Is there a way to determine the measure of the discontinuities of a function, with the information given above, i.e. that $g$ is so close to being Riemann Integrable (if we could just determine if those finitely or countably many points matter enough to make the measure of the discontinuities zero.)

Or is it enough just to note that a set with finitely many points or countably many points must have measure zero and conclude that since the discontinuities of $f$ had measure zero, "removing" points that have measure zero shouldn't affect our measure of the discontinuities of $f$?

Thanks for any assistance.

• What is $\mathcal{R}[a,b]$? – Thomas Andrews Feb 2 '15 at 15:50
• @ThomasAndrews: It is the space of Riemann Integrable functions on the interval $[a,b]$. – Sujaan Kunalan Feb 2 '15 at 15:55
• Then it's true if they differ by finitely many, but not countably many. – Thomas Andrews Feb 2 '15 at 15:56
• Your statement is true for Lebesgue integrable functions, but Riemann integration is limited. It is one of the reasons we need Lebesgue. :) – Thomas Andrews Feb 2 '15 at 16:00

This is not true. Consider $f$ to be identically zero and $g$ to be the characteristic function of the rationals. $g$ is discontinuous everywhere.