If $f$ is a strictly-increasing differentiable function, how can we characterise the set of points where $f'$ vanishes? I am trying to determine necessary and sufficient constraints on the set of roots of a positive derivative $f'(x) \geqslant 0$ that determine whether $f$ is strictly increasing or just increasing.
Now, in high school I learned that

If $f'(x) \geqslant 0$ for all $x$, and $f'(x)=0$ has finitely-many solutions, then $f$ is strictly increasing.

While this is a useful statement, I realise that the condition on $f'$ is necessary but certainly not sufficient. Indeed, it is easy to construct a strictly-increasing function whose derivative vanishes on a countably-infinite set of points (take for instance $f(x)=\int_0^x \sin^2{t}\ \mathrm{d}t$).
In fact, it is even possible to construct a strictly-increasing function whose derivative vanishes over an uncountable set. Here's a construction I came up with:

Let $\mathcal{C} \subset [0,1]$ be the Cantor set. Define $I:[0,1]\to \left\{0,1\right\}$ such that $I(x)=0$ if $x \in \mathcal{C}$ and $I(x)=1$ if $x \notin \mathcal{C}.$ Then define $$f(x)=\int_0^x I(t)\ \mathrm{d}t, \qquad \ \ \ 0 \leqslant x \leqslant 1.$$ Since $\mathcal{C}$ is measure-zero, it is not hard to show that $I(x)$ has measure-zero discontinuity and hence that $f(x)$ is a well-defined integral in the Riemann sense. Further, one can show that $f(x)$ is strictly increasing, and $f'(x)=0$ for all $x\in \mathcal{C}$, which is an uncountable set.

I suspect that the necessary and sufficient condition for $f$ to be strictly-increasing is that the set where $f'$ vanishes must be nowhere dense:

Proposition. Let $f$ be a differentiable function with $f'(x) \geqslant 0$ for all $x$, and let $S$ be the set of points where $f'$ vanishes. Then $f$ is strictly-increasing iff $S$ is nowhere-dense.

Here is my proposed proof:

Proof. Equivalently, we prove the negation of the statement, namely that $f$ is locally-constant on some interval iff it some nonempty subset of $S$ is dense:
$(\Rightarrow)$ If $f$ is locally-constant on some interval, call it $J$, then $f'(x)=0$ for $x \in J$ hence $S \cap J \subseteq S$ is dense since it is an interval.

However I am not able to prove the statement in the other direction. Assuming that my proposition is true, can someone help me out on the proof? If the statement isn't true, then what would be a possible counter-example? And what would be the characterisation of $S$?
 A: Here is an alternative necessary and sufficient condition. 
Claim:  Suppose  $f:\mathbb{R}\rightarrow\mathbb{R}$ is a differentiable function with $f’(x)\geq 0$ for all $x \in \mathbb{R}$.  Then $f$ is strictly increasing if and only if on every interval $[a,b]$ with $a<b$, there is a point $c \in (a,b)$ such that $f’(c)>0$. 
Proof:  Suppose $f$ is strictly increasing.  Let $a,b$ be real numbers such that $a<b$.  Then $f(a)<f(b)$. The intermediate value theorem implies there is a $c \in (a,b)$ such that $f’(c) = \frac{f(b)-f(a)}{b-a}>0$. 
Now suppose $f$ is such that on every interval $[a,b]$ with $a<b$, there is a point $c \in (a,b)$ such that $f’(c)>0$.  Fix any real numbers $a,b$ such that $a<b$.  We want to show $f(a)<f(b)$. Let $c \in (a,b)$ be a number such that $f'(c)>0$. 
By definition of derivative, we have for all sufficiently small $h>0$: 
$$ \frac{f(c+h)-f(c)}{h}  >0$$
Hence, there is an $h>0$ such that $a < c < c+h < b$ and $f(c+h)-f(c) > 0$ and so: 
$$ f(a) \overset{(a)}{\leq} f(c) < f(c+h) \overset{(b)}{\leq} f(b) $$
where (a) and (b) hold because $f$ is nondecreasing. $\Box$
