Let f be continuous on [a,b] and define a function g(x) on [a,b] as follows
g(a)=f(a) and for a $\lt\ $x $\le\ $b then g(x) be the maximum value of f(t) on [a,x]. Prove that g(x) is continuous of [a,b].
I was following along with an example in the text that I have that states
If f and g are continuous real functions on [a,b] which are differentiable in (a,b) then there is a point $x \in$ (a,b) at which
$$[f(b)-f(a)]g'(x) = [g(b)-g(a)]f'(x)$$
the proof is the "generalized mean value theorem" I was wondering if it was ok to use it in this case and where it would apply in the question.