Let $A \subset \mathbb{R}^{n}$ be a closed set. Does there exist an open set $O$ containing $A$, and a smooth function $f : O \to \mathbb{R} $ such that


$f(x) = 0$ for all $x \in A$,


$f(x) > 0$ and $\nabla f(x) \ne 0$ for all $x \in O \setminus A$,


and $f(x) \to \infty$ as $x \to \partial O$ ?



Existence of a particular positive definite and radially unbounded function
Not always possible.


Let $n = 1$. Take $A \subsetneq [0,1]$ be the usual ternary Cantor set.  

Every point in $A$ is a limit point.  

Let $O$ be any open set containing $A$, then $O$ must contain *some* interval of the form $(a,b)$ with $a,b\in A$. Since $f(a) = f(b) = 0$ is needed, if we want $f(x) > 0$ on $O\setminus A$, we must have that $f(x)$ attains an interior maximum where it has a critical point.


Similar examples can be built in higher dimensions.


