$$
\left|\frac{f(x)-f(t)}{x-t}\right| \le |x-t|\to 0 \text{ as }x\to t.
$$
So $f'(t)=0$ for all values of $t$, so you have a constant function.
PS: The mean value theorem is usually cited in proofs that if $f'=0$ everywhere, then $f$ is constant. If the real line had a gap somewhere, then we could have $f=3$ everywhere to the left of the gap and $f=4$ everywhere to the right of the gap, and $f'=0$ everywhere. However, I wonder if the thing to be proved here might be provable without the gaplessness of the line, and hence without the mean value theorem.