Consider a non-decreasing function $f:[0,1]\to\mathbb{R}$ such that:
- $f$ is differentiable a.e. in $[0,1]$, and
- there exists an open set $O\subseteq[0,1]$ such that, $f^\prime(x)=0$ a.e. in $O$ and $O$ is dense in $[0,1]$.
Does this imply $f$ is constant in $[0,1]$ ?
Can $f$ be non-constant if the set $\mathbb{R}/O$ has a positive Lebesgue measure ? (Such an open set is possible. Consider the example in this answer.)