Comment only.
The idea in the proof that Giorgos has given is worth pondering over. If there were no points at which $f'(x)$ failed to be positive, then (using the intermediate value property of continuous functions) select any $c\in (a,b)$ with $f(a)>c>f(b)$ and use his "last point argument" to consider
$$ \beta =\sup\{ x\in (a,b): f(x)>c\}$$
where we are sure that $f'(\beta)>0$ etc.
If there is a set of points $E\subset (a,b)$ where we perhaps do not have a positive derivative, well... just avoid them. If $E$ is countable, so is $f(E)$ and there is plenty of room to choose a value $c\not\in f(E)$. That will get us a $\beta\not\in E$ etc.
That method leads to an interesting and simple generalization using the same method, due to Antoni Zygumund. As a follow up to this "exercise" I recommend proving this theorem.
Theorem (Zygmund) Let $f$ be a continuous function such that the set of values assumed by $f(x)$ at the points $x$ where the upper
right Dini derivative $D^+f(x)\leq 0$ contains no nondegenerate
interval. Then $f$ is monotone nondecreasing.