Let $f: \mathbb R^n \to \mathbb R$ be a Lipschitz function with $|\nabla f| = 1$ almost everywhere with respect to Lebesgue measure.
What is the supremal Hausdorff dimension of the set on which $f$ is differentiable with $\nabla f = 0$?
Remark: In one dimension, as $f$ must take the form $f(x) = \int_{0}^{x} \mathbf 1_{A} - \mathbf 1_{A^c} $ for some measurable $A$, the question reduces to the following. For $A \subset \mathbb R$ measurable, what is the supremal Hausdorff dimension of the set on which the upper and lower density of $A$ both equal $\frac{1}{2}$?