fundamental theorem of calculus part I I'm having difficulty understanding the proof showing $g(x)$ is continuous on $[a,b]$ from the book Calculus written by James Stewart.

Can any kind soul help me?
 A: Hint
Let $x\in(a,b)$ and $h>0$ small.
$g(x+h)-g(x)=\int_x^{x+h}f(t)dt$
$$=((x+h)-x)f(c_h)$$
with $x\leq c_h\leq x+h$ cause $f$ is continuous at $[x,x+h]$: first mean value formula.
thus $\frac{g(x+h)-g(x)}{h}=f(c_h)$.
when $h\to0 , $
$g(x+h)\to g(x)$ (continuity),
$c_h\to x $ and
$f(c_h)\to f(x)=g'(x)$ (differentiability).
A: Note that the function $g$ is continuous on $[a, b] $ provided $f$ is Riemann integrable on $[a, b] $. Continuity of $f$ is not needed to ensure continuity of $g$. 
To prove continuity of $g$ at some point $c\in [a, b] $ we observe that $$|g(c+h) - g(c) |=\left|\int_{c} ^{c+h} f(t) \, dt\right|\leq |h|M$$ where $M$ is an upper bound for $|f|$ on $[a, b] $. This proves continuity of $g$ at $c$. 
Next we show that if $f$ is continuous at $c\in (a, b) $ then $g$ is differentiable at $c$ and $g'(c) =f(c) $. Since $f$ is continuous at $c$, for every $\epsilon>0$ there is a $\delta>0$ such that $|f(t) - f(c) |<\epsilon $ for all $t\in(c-\delta, c+\delta) $. Thus if $0<|h|<\delta$, we then have $$\left|\frac{g(c+h) - g(c)} {h}-f(c) \right|= \left|\frac{1}{h}\int_{c}^{c+h}\{f(t)-f(c) \} \,dt\right|\leq\frac{1} {|h|}\cdot\epsilon|h|=\epsilon $$ This means that $g'(c) =f(c) $.
Your textbook is trying to show that if $f$ is continuous on $[a, b] $ then $g$ is differentiable on $(a, b) $ and it's right hand derivative exists at $a$ and left hand derivative exists at $b$ and it is using the existence of derivative of $g$ to conclude that $g$ is continuous on $[a, b] $.
A: Sorry This is not a complete answer but i hope it can help you 
proof. Let us give the argument x a positive or negative increment $\Delta x$;then we get 

property : for any three numbers a,b,c the equality 
$$\int_{a}^{b}f(x)dx=\int_{a}^{c}f(x)dx+\int_{c}^{b}f(x)dx$$
is true ,provided all these three integrals exist

$$\Phi(x+\Delta x)=\int _{a}^{x+\Delta x}f(t)dt=\int _{a}^{x}f(t)dt+\int _{x}^{x+\Delta x}f(t)dt$$
the increment of function $\Phi(x)$ is equal to 
$$\Delta \Phi =\Phi(x+\Delta x)-\Phi(x)=\int _{a}^{x}f(t)dt+\int_{x}^{x+\Delta x}f(t)dt-\int_{a}^{x}f(t)dt$$
that is 
$$\Delta \Phi=\int _{x}^{x+\Delta x}f(t)dt$$
Apply to the letter integral the mean-value theorem :

mean-value theorem : if a function f(x) is continuous on the interval
  [a,b], then there is a point $\zeta$ on this interval such that the
  following equality holds  $$\int_{a}^{b}f(x)dx=(b-a)f(\zeta).$$

$$\Delta \Phi=f(\zeta)(x+\Delta x-x)=f(\zeta)\Delta x $$
where $\zeta$ lies between x and $x+\Delta x$ 
Find the ratio of the increment of the function to the incrementof the argument:
$${\Delta \Phi \over \Delta x}={f(\zeta)\Delta x\over\Delta x}=f(\zeta)$$
hence,
$$\Phi'(x)=\lim_{\Delta x \to 0}{\Delta \Phi \over \Delta x}=\lim_{\Delta x \to 0}f(\zeta)$$
but since $\zeta \to x$ as $\Delta x \to 0$ we have 
$$\lim_{\Delta x \to 0}f(\zeta)=\lim_{\zeta \to x}f(\zeta)$$
and due to the continuity of the function f(x)
$$\lim_{\zeta \to x}f(\zeta)=f(x)$$
thus,$\Phi'(x)=f(x)$,and the theorem is proved.
[Differential And Integral Calculus - N Piskunov]
