If $f$ is Riemann integrable on $[a, b]$, and the value of $g$ agrees with $f$ at almost every point (except on a set of Lebesgue measure 0), is it true that $g$ Riemann integrable and $\displaystyle \int_{a}^{b} g(x) dx=\int_{a}^{b} f(x) dx$?
I have managed to show that if $f$ and $g$ are both integrable and their values agree at almost every point (except on a set of measure 0), then $\displaystyle \int_{a}^{b} g(x) dx=\int_{a}^{b} f(x) dx$. However, I wonder if we have to assume that $g$ is integrable or we can derive it with the integrability of $f$. If not, what would be a counter-example?