# Is the derivative of a nonconstant Lipschitz functions non-zero almost everywhere?

let $U\subset \mathbb{R}^2$ be an open set and $f:U\rightarrow \mathbb{R}$ be Lipschitz continuous, which is not constant. By Rademacher's theorem, the function is differentiable almost everywhere. I am wondering if it is true that $\vert \nabla f \vert \neq 0$ almost everywhere. For a couple of examples, it seems to work, but I do not know if that statement is true in general. Does anyone know the answer and can tell me, where I can find a proof?

• Have a look at this question math.stackexchange.com/questions/1884140/…
– mfl
Aug 16, 2018 at 10:52
• What if $f$ is constant on some disc in $U$?
– user360359
Aug 16, 2018 at 11:49

The function $f(x) = \max(x, 0)$ is Lipschitz continuous on $\mathbb{R}$, and is not a constant function. Its derivative is zero for all negative $x$. An example on $\mathbb{R}^2$ would be $f(x, y) = \max(x, 0)$.
The problem is more interesting if we assume $f$ is not constant on any nonempty open set. The answer is still negative though. Let $E\subset\mathbb{R}$ be a closed set with empty interior and positive measure (e.g., Smith–Volterra–Cantor set). Define $f(x)=\operatorname{dist}(x, E)$. This function is Lipschitz continuous on $\mathbb{R}$. As you noted, $f'(x)$ exists a.e. on $\mathbb{R}$. Since every point of $E$ is a point of minimum for $f$, it follows that for $x\in E$, the only possible value of $f'(x)$ is $0$. In conclusion, $f'=0$ on a set of positive measure. For $\mathbb{R}^2$, use $f(x, y) = \operatorname{dist}(x, E)$.