TITLE: Zero derivative implies constant function (No MVT, Rolle's Theorem, etc.)
QUESTION [7 upvotes]: I'm working through Foundations of Mathematical Analysis by Johnsonbaugh.
The following problem is given before MVT is proven.
However, we do know about compactness, completeness, continuity, intermediate value theorem, metric spaces, sequences, etc.
I am trying to find a proof that does not use MVT. This question seems similar to mine, but they end up using something equivalent to Rolle's theorem in the answer.
Problem:
Suppose $f'(x) = 0$ for all $x \in (a,b)$. Prove that $f$ is constant on $(a,b)$.
Attempt:
Let $x,y \in (a,b)$. We have
$$f'(x) = \lim_{z \to x} \frac{f(z)-f(x)}{z-x} = 0$$
and
$$f'(y) = \lim_{z \to y} \frac{f(z)-f(y)}{z-y} = 0$$

REPLY [6 votes]: Note that since $f$ is differentiable on $(a,b),$ $f$ is continuous on $(a,b).$
Suppose $a<c<d<b.$ We'll show $f(c)-f(d)=0,$ which implies $f$ is constant. Let $\epsilon>0.$ Define
$$E=\{x\in [c,d]:|f(x)-f(c)|\le \epsilon(x-c)\}.$$
Then $c\in E,$ so $E$ is nonempty. Let $s= \sup 
E.$ Then there is a sequence $x_n$ in $E$ such that $x_n\uparrow s.$ The continuity of $f$ then shows $s\in E.$
Suppose $s<d.$ Because $f'(s) = 0,$ there exists $x\in (s,d)$ such that $|f(x)-f(s)|\le \epsilon(x-s).$ We then have
$$|f(x)-f(c)|\le |f(x)-f(s)| + |f(s)-f(c)| \le \epsilon(x-s)+\epsilon(s-c) = \epsilon(x-c).$$
Thus $x\in E$ and $x> s,$ contradiction. Therefore $s=d,$ and since we know $s\in E,$ we have $d\in E.$ That means $|f(d)-f(c)|\le \epsilon(d-c).$ Since $\epsilon$ was arbitrary, we have $f(d)=f(c)$ as desired.