This a self-answered question, which I post since it wasn't trivial for me to find. (Alternative solutions are welcomed, of course).
How to prove the following statement:
There exists an injective Lipschitz map $g:\mathbb{R} \to \mathbb{R}$, where $g'=0$ on a set of positive measure.
The idea is taken from this answer.
Let $A \subseteq \mathbb{R}$ be any nowhere dense measurable set, having positive measure. (e.g. the fat Cantor set). Define $$h:=1_{\mathbb{R}\setminus A},\quad g(x):=\int_0^x h(t)\,dt.$$
We claim that $g:\mathbb{R}\to\mathbb{R}$ is a strictly increasing $1$-Lipschitz function satisfying $g'=0$ a.e. on $A$.
Proof:
$g$ is strictly increasing:
Since $h \ge 0$, $g$ is non-decreasing. Suppose that $g(x)=g(y)$ for some $x<y$. Then $\int_x^y h=0$, so $h|_{[x,y]}=0$ a.e., thus for almost every $z \in [x,y]$, $z \in A$, or equivalently $[x,y]\cap A$ has full measure in $[x,y]$, thus $$[x,y]=\overline{[x,y]\cap A} \subseteq [x,y]\cap \overline{A} \subseteq \overline{A},$$
so $\overline{A} \supseteq [x,y]$ in contradiction to $A$ being nowhere dense.
$g$ is $1$-Lipschitz:
$|g(x)-g(y)| \le \int_x^y |h| \le |x-y|$.
$g'=0$ a.e. on $A$:
By Theorem 14 (pg 126 in "Real Analysis by Royden--fourth edition),
$g'(x)=h(x)$ a.e. on $\mathbb{R}$, so $g'(x)=0 \iff h(x)=0 \iff x \in A$ as required.
Comment:
Since any Lipschitz function $g(x)$ is the integral of its derivative, i.e. $g(x)=g(0)+\int_0^x g'$ (Theorem 10 pg 142 in Royden's book), all such Lipschitz maps arise in essentially similar fashion.