$f \in \mathcal{R}[a, b]$, $g$ is a bounded real-valued function on $[a, b]$ s.t. $f(x) = g(x)$ almost everywhere. Is $g \in \mathcal{R}[a, b]$?

Suppose that $f \in \mathcal{R}[a, b]$ and $g$ is a bounded real-valued function on $[a, b]$ such that $f(x) = g(x)$ almost everywhere.

Does this mean that $g \in \mathcal{R}[a, b]$?

I think that if $g = f^\mathrm{1/2}$, then it would not be true that $g \in \mathcal{R}[a,b]$ as a consequence. On the other hand, it would be true for $g = f^\mathrm{1/3}$

Of course, these are not necessarily good examples for the given: $f(x) = g(x)$ almost everywhere

If this is not true, is there an "classic" example of why it doesn't work?


No. Let $f:[0,1]\rightarrow \mathbb{R}$ be defined by $f=0$ and $g:[0,1]\rightarrow \mathbb{R}$ be the Dirichlet function, i.e., $g(x)=0$ if $x$ is irrational and $g(x)=1$ if $x$ is rational. Clearly, $f$ is Riemann integrable, $g$ is bounded, and $f=g$ a.e.. However, $g$ is not Riemann integrable.