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.

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.
