continuous function with zero right-derivative implies it is constant

48 Views Asked by At

Suppose $f$ is continuous on $[a,b]$ and $f_{r}'(x)=0$ (right-derivative) for all $x\in[a,b)$. Prove that $f$ is constant on $[a,b]$.

My approach is to use MVT:

There exists $c\in(y,x)$ s.t. $\frac{f(y)-f(x)}{y-x}=f'(c)$ for all $x\in[a,b]$.

Then,

$0=f_{r}'(x)=\lim_{y\to x^+}f'(c)=\lim_{c\to x^+}f'(c)$,

implying that $f$ is constant. But I think there is some problem on my step using right derivatives. Can anyone help me find the flaws in my proof? Thanks.