Let $D \subseteq \mathbb{R}^n$ be open, connected, bounded. Let $f : D \to \mathbb{R}$ be $C^1$ and assume that $f$ as well as $\partial\_i f$ extend as continuous functions to the closure $\overline{D}$ of $D$ for all $i \in \{1, \ldots, n\}$.


The paper [Functions Differentiable on the Boundaries of Regions](https://doi.org/10.2307/1968745) by Whitney shows in particular that if $D$ is quasi-convex (Property P in the paper) then one can extend $f$ as a $C^1$ function to all of $\mathbb{R}^n$.


I would guess this fails if one does not make a suitable assumption like quasi-convexity on the domain $D$ — does anyone know a good counterexample?



If function and derivative extend continuously to boundary of domain, can one extend as $C^1$ function?
The failure is essentially local, so the boundedness we can ignore for the purpose of this example.


* Let $D = \{ y < |x|^{1/4}: (x,y)\in \mathbb{R}^2\}$.
* Let $\phi:\mathbb{R}\to\mathbb{R}$ be such that $\phi(y) = 0$ for $y \leq 0$ and $\phi(y) = y^2$ for $y > 0$.
* Let $f:D\to \mathbb{R}$ be given by $f(x,y) = \mathrm{sign}(x) \phi(y)$.


We have $\partial\_x f \equiv 0$ and
$$
\partial\_y f = 
\begin{cases} 
0 & y \leq 0 \\ 
2\mathrm{sign}(x) y & y > 0
\end{cases}.
$$ It is not too hard to see that $f$ and its first derivatives have continuous extensions to $\bar{D}$.


Fixing $y >0$, applying the mean value theorem to $x\mapsto f(x,y)$, we see that any putative differentiable extension will require there having a point with $|x| \leq y^4$ that satisfy $\partial\_x f(x,y) = y^{-2}$. This shows it is impossible to have a $C^1$ extension to all $\mathbb{R}^2$ as the continuous extension of $\partial\_x f(0,0) = 0$.


