Does $f'(x) = g'(x)$ for all $x \in (a, b)$ imply $f(x) = g(x) + c$ for all $x \in [a ,b]$? My question is regarding the open and closed intervals in the statement. I can see why the result holds on the open interval $(a, b)$, but does it also hold at the endpoints $a$ and $b$?
EDIT: Here is some more context on the question.
This appears in the proof that if $f$ is continuous on $[a, b]$, $f$ is integrable on $[a, b]$.
Let $L(x) = L \int_a ^ x f$ and $U(x) = U \int_a ^x f$ be the lower and upper integrals evaluated on $[a, x]$, where $x \in (a, b)$. It is shown that
\begin{equation*}
 L'(x) = U'(x) = f(x)
\end{equation*}
for all $x \in (a, b)$. The author then states without proof that this implies there exists a number $c$ such that
\begin{equation*}
 U(x) = L(x) + c
\end{equation*}
for all $x \in [a, b]$. The inclusion of the right endpoint $b$ is necessary in completing the proof.
In my question, I have substituted $L(x), U(x)$ with $f(x), g(x)$. To the best of my knowledge, all we know about $L(x)$ and $U(x)$ at this point is that they are differentiable on $(a, b)$.

Assuming that $f$ and $g$ are continuous on $[a,b]$, then, yes, it is true. For instance,$$f(a)=\lim_{x\to a}f(x)=\lim_{x\to a}g(x)+c=g(a)+c.$$The same argument applies to $b$.
