In this article of Wikipedia it is stated that, if $\Omega$ is a subset of $\mathbb{R}^n$ with smooth boundary, then $$f(x)=\begin{cases} d(x,\partial\Omega),\;\;x\in\Omega\\ -d(x,\partial\Omega),\;\;x\notin \Omega \end{cases}$$ satisfies $|\nabla f(x)|=1$ for all $x\in\mathbb{R}^n$. Could you give me an outline of the proof?
I read an answer in this site solving in fact this question, but I do not understand it (maybe not enough details, maybe my level of geometry is not good...)
Motivation: Coarea formula says that, if $g\in L^1(\Omega)$, $u\in C^1(\bar{\Omega})$ and $|\nabla u|>0$, then $\int_{\Omega} g\,dx=\int_{\mathbb{R}}\int_{\{u=\lambda\}} g/|\nabla u|\,d\sigma\,d\lambda$. In the particular case $u(x)=d(x,\partial\Omega)$, I read that $\int_{\Omega} g\,dx=\int_{\mathbb{R}}\int_{\{u=\lambda\}} g\,d\sigma\,d\lambda$.