Is this proof correct:
Let's choose a $\delta$ to that
$a < x - \delta < x < x + \delta < b$
If $ x - \delta < t < x$
then $\frac {f(t) - f(x)} {t-x} \geq 0$
Letting $t \rightarrow x$, we see that $f'(x) \geq 0$
If $ x < t < x + \delta$,
then $\frac {f(t) - f(x)} {t-x} \leq 0$
Which shows that $f'(x) \leq 0$. Hence $f'(x) = 0$
Yes, it is. Maybe you want to say $t\to x^+$ and $t\to x^-$ explicitly.