Proof: If $f'=0$ then is $f$ is constant I'm trying to prove that if $f'=0$ then is $f$ is constant WITHOUT using the Mean Value Theorem.
My attempt [sketch of proof]: Assume that $f$ is not constant. Identify interval $I_1$ such that $f$ is not constant. Identify $I_2$ within $I_1$ such that $f$ is not constant. Repeat this and by the Nested Intervals Principle, there is a point $c$ within $I_n$ for any $n$ such that $f(c)$ is not constant... This is where I realized that my approach might be wrong. Even if it isn't I don't know how to proceed.
Thanks for reading and any help/suggestions/corrections would be appreciated.
 A: Depending on how much technology you want to use, you could perhaps use the fact that $H^0_{\text{dR}}(\mathbb{R}^n) \cong \mathbb{R}$. (This follows from $\mathbb{R}^n$ being homotopy equivalent to a point) Hence any closed $0$-form (so any function smooth function $f:\mathbb{R} \rightarrow \mathbb{R}$ with $df=0$) is constant. 
I think that all of this doesn't use the Mean Value Theorem, but I guess it's a bit of an overkill...
A: So we have to prove that $f'(x)\equiv0$ $\ (a\leq x\leq b)$ implies $f(b)=f(a)$, without using the MVT or the fundamental theorem of calculus.
Assume that an $\epsilon>0$ is given once and for all. As $f'(x)\equiv0$, for each fixed $x\in I:=[a,b]$ there is a neighborhood $U_\delta(x)$ such that
$$\Biggl|{f(y)-f(x)\over y-x}\Biggr|\leq\epsilon\qquad\bigl(y\in\dot U_\delta(x)\bigr)$$
($\delta$ depends on $x$). For each $x\in I\ $ put $U'(x):=U_{\delta/3}(x)$. Then the collection $\bigl(U'(x)\bigr)_{x\in I}$ is an open covering of $I$. Since $I$ is compact there exists a finite subcovering, and we may assume there is a finite sequence $(x_n)_{0\leq n\leq N}$ with
$$a=x_0<x_1<\ldots< x_{N-1}<x_N=b$$
such that $I\subset\bigcup_{n=0}^N\  U'(x_n)$. The $\delta/3$-trick guarantees that $$|f(x_n)-f(x_{n-1})|\leq \epsilon(x_n-x_{n-1}).$$ By summing up we therefore obtain the estimate $|f(b)-f(a)|\leq \epsilon(b-a)$, and as $\epsilon>0$ was arbitrary it follows that $f(b)=f(a)$.
A: Does the real line have gaps?  That's the issue.  Suppose you can partition the line into two sets $A$ and $B$, so that


*

*Every real number belongs to either $A$ or $B$;

*No number belongs to both;

*Every member of $A$ is less than every member of $B$;

*For every member of $A$, there is a larger number that is still a member of $A$;

*For every member of $B$, there is a smaller number that is still a member of $B$.


In that case, there would be no boundary point, such that every number less than that point is in $A$ and every number greater than that is in $B$.  That would be a gap.
Now suppose $f(x) = 0$ if $x\in A$ and $f(x)=1$ if $x\in B$.  Then $f\;'(x)=0$ for every value of $x$, but $f$ is not constant.
You can't prove every function whose derivative is everywhere $0$ is constant unless you rule out gaps.  The proof of the mean value theorem conventionally relies on Rolle's theorem, which in turn relies on the fact that a continuous function on a closed interval has a maximum and a minimum in that interval.  That theorem is not true unless the real line is gapless.  A continuous function could increase on the set $A$ described above and decrease on $B$, and it would have no maximum.
The mean value theorem is how the gaplessness of the line gets involved in the proof that if $f\;'=0$ everywhere then $f$ is constant.
Probably you could find other ways of proving that, but they'd have to invoke gaplessness somehow.
A: There's a constructive proof of this fact (which uses dependent choice), though it can easily be altered into a non-constructive proof which does not use dependent choice.
Suppose given $a \leq b$ and $f: (a, b) \to \mathbb{R}$ which is differentiable on $(a, b)$, and suppose that for all $x \in (a, b)$, $f'(x) = 0$.  Take $c, d \in (a, b)$ such that $c < d$.  We will show that $f(c) \geq f(d)$.  
Proof: We note that $f(c) \geq f(d)$ iff it is not the case that $f(c) < f(d)$ - this is true constructively.  Suppose now that $f(c) < f(d)$.  
We will construct a sequence of pairs $\{(c_i, d_i)\}_{i = 0}^\infty$ such that for all $i \in \mathbb{N}$, $f(d_i) > f(c_i) + (f(d) - f(c)) / 2^{i+1}$; furthermore, $\{c_i\}$ will be monotonically increasing sequence while $\{d_i\}$ will be monotonically decreasing, and we will have $d_i = c_i + (d - c) 2^{-i}$.  
Define $c_0 = c$ and $d_0 = d$.  Then we have $c \leq c_0 \leq d_0 \leq d$, and we have $f(d) > (f(d) + f(c))/2$ and therefore $d_0 > c_0 + (d - c)/2$; and clearly, we have $d_0 = c_0 + (d - c) / 2^0$.  Now suppose we have $c_i$ and $d_i$ satisfying the above properties.  Then we have $f(c_i) + (f(d) - f(c)) / 2^{i+2} < f(d_i) - (f(d) - f(c)) / 2^{i + 2}$.  Let $m = (c_i + d_i) / 2$.  By the locatedness property of Dedekind cuts, we either have $f(m) > f(c_i) + (f(d) - f(c)) / 2^{i+2}$ or $f(m) < f(d_i) - (f(d) - f(c)) / 2^{i + 2}$.  Using dependent choice, we either choose $(c_{i + 1}, d_{i + 1}) = (c_i, m)$ in which case $f(m) > f(c_i) + (f(d) - f(c)) / 2^{i + 2}$, or we choose $(c_{i + 1}, d_{i + 1}) = (m, d_i)$ in which case $f(m) < f(d_i) + (f(d) - f(c)) / 2^{i + 2}$; in either case, we have $d_i = c_i + (d - c) / 2^{i + 1}$; and we have $f(d_{i + 1}) > f(c_{i + 1}) + (f(d) - f(c)) / 2^{i + 2}$; and we have $c_i \leq c_{i + 1}$ and $d_i \geq d_{i + 1}$.  
Now the $c_i$ and $d_i$ are clearly Cauchy sequences which converge to the same value; call the limit $x$.  We see that $c \leq x \leq d$; then $x \in (a, b)$; then $f'(x) = 0$.  Then $\lim\limits_{h \to x} \frac{f(h) - f(x)}{h - x} = 0$.  This implies that for all $\epsilon$, there is some $\delta$ such that for all $h \in (x - \delta, x + \delta)$, $|f(h) - f(x)| \leq \epsilon |h - x|$ and therefore, for all $h_1 \in (x - \delta, x]$ and $h_2 \in [x, x + \delta)$, $|f(h_2) - f(h_1)| \leq \epsilon (h_2 - h_1)$.  But now set $\epsilon = \frac{f(d) - f(c)}{2(d - c)}$ and take an appropriate $\delta$.  Take $i$ such that $c_i \in (x - \delta, x]$ and $d_i \in [x, x + \delta)$.  Then $f(d_i) - f(c_i) > \frac{f(d) - f(c)}{2^{i + 1}} = \epsilon \frac{d - c}{2^i} = \epsilon (d_i - c_i)$.  Contradiction.  Then it cannot be the case that $f(c) < f(d)$; then $f(c) \geq f(d)$.
The same argument shows that $f(c) \leq f(d)$.  Therefore, whenever $c < d$, we have $f(c) = f(d)$.  
Finally, take arbitrary $x, y \in (a, b)$.  Then $a < x$ and $a < y$.  Take rational numbers $r \in (a, x)$ and $p \in (a, y)$; let $w = \min(r, p)$.  Then $w < x$ and $w < y$.  Then $f(w) = f(x)$ and $f(w) = f(y)$; then $f(x) = f(y)$.  Then $f$ is constant.  QED.
