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)$.
 A: 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$.
A: Converting my comments into an answer.

Probably you are studying the proof of integrability of continuous functions from Spivak's Calculus. This particular proof based on derivative of upper and lower Darboux integrals is not as popular as the one via uniform continuity.
You should first prove that if $f$ is any bounded function on interval $[a, b] $ then its upper and lower Darboux integrals $L, U$ given by $$L(x) =\underline{\int_{a}^{x}} f(t) \, dt,\, U(x) =\overline{\int_{a} ^{x}} f(t) \, dt$$ are continuous on interval $[a, b] $.
Next one establishes that if $c\in[a, b] $ and $f$ is continuous at $c$ then $L'(c)= U'(c)=f(c) $. If $c$ is an end point then the above statement refers to one sided continuity and differentiability.
Thus if $f$ is continuous on $[a, b] $ then $L, U$ are continuous on $[a, b] $ and also differentiable on $[a, b] $ (one sided derivatives at end points) and $L'(x) =U'(x) =f(x), \forall x\in[a, b] $. Your job is now complete via application of mean value theorem on $L-U$ on $[a, b] $.
I have given outline of the proof and if you need more details let me know.
