Let $f : \mathbb R \to \mathbb R$ be a differentiable function such that $f'(x) \geq 0, \forall x \in \mathbb R$. Suppose $f'(x) = 0$ at at-most countable points. Is $f$ strictly increasing? (maybe $\lambda$-almost everywhere?, where $\lambda$ is Lebesgue measure)
I define $U = \{(x,y) \in \mathbb R^2: x < y \text{ and } f(x) = f(y) \}$, then I want to prove that $U$ is at most countable (thus its Lebesgue measure is $0$). Is my approach correct?
The function is strictly increasing.
Suppose $x<y$, but $f(x)=f(y)$. Pick $c$ such that $x<z<y$. Suppose that $f(x)>f(z)$. Then applying the Mean Value Theorem, there exists a point $a$ with $x<a<z$ with $f'(a)<0$. This is a contradiction, so $f(x)\leq f(c)$. Likewise, $f(z)\leq f(y)$, so $f(x)=f(z)=f(y)$. We conclude that $f$ is constant on $[x,y]$, a contradiction.