Proof: If $f'=0$ then is $f$ is constant
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)$.
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.
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...