Let $f:[a,b]\to\mathbb R$ be a differentiable function with $f'$ bounded. According to this post, $f'$ is not necessarily Riemann integrable on $[a,b]$, see also Volterra's function.
I wonder, if $f'$ is not Riemann integrable on $[a,b]$, does there exist a Riemann integrable function $g:[a,b]\to\mathbb R$ such that $g=f'$ a.e. and $$f(x)-f(a)=\int_a^xg(t)\,dt,\qquad \forall x\in[a,b] ?\tag{$*$}$$ In $(*)$ we use Riemann integration.
There are some trivial observations.
Fistly, the boundedness of $f'$ implies that $f$ is absolutely continuous, hence $f'$ is Lebesgue integrable and $$f(x)-f(a)=\int_a^xf'(t)\,dt,\qquad \forall x\in[a,b]$$ holds in the sense of Lebesgue integration.
There exists a bounded Lebesgue integrable function $h:[0,1]\to\mathbb R$ such that we cannot find a Riemann integrable function $g:[0,1]\to\mathbb R$ with $g=h$ almost everywhere: Take $h$ to be the characteristic function of a fat Cantor set $F$ with $0<\lambda(F)<1$, where $\lambda$ denotes the Lebesgue measure, then $h$ is discontinuous at every point in $F$, since $F$ does not contain any open interval.
We note that if $(*)$ holds for $g$, then we have $g=f'$ almost everywhere. Indeed, $(*)$ implies that if $g$ is continuous at $x_0$, then $f'(x_0)=g(x_0)$, hence $$\{x\in[a,b]: f'(x)\neq g(x)\}\subset \{x\in[a,b]: g \text{ is not continuous at }x\},$$ and hence $g=f'$ a.e. since $g$ is Riemann integrable.
Also, it is well known that if $g:[a,b]\to\mathbb R$ is Riemann integrable and $h:[a,b]\to\mathbb R$ is bounded such that $h=g$ a.e., then $h$ is not necessarily Riemann integrable. For example, take $g\equiv0$ on $[0,1]$ and $h$ the characteristic function of $\mathbb Q\cap[0,1]$.
Note that derivatives of everywhere differentiable functions cannot be arbitrarily badly behaved. For example, they satisfy the conclusion of the intermediate value theorem.