Preimage under a continuous positive definite function Consider a continuous positive definite function:
$$
f:D \rightarrow \mathbb{R}_+\\
f(0) = 0\\
\forall x \in D \setminus \{0\}: f(x) > 0
$$
where $0 \in D \subseteq \mathbb{R}^n$ and $D$ is unbounded.
I want to show that
$$
\exists \epsilon > 0: \exists r> 0: \forall x \in D:(f(x)=\epsilon \Rightarrow \Vert x \Vert \leq r)
$$
which says that there exists $\epsilon > 0$ such that the preimage $f^{-1}[\epsilon]$ is bounded. This is a seemingly true statement but I don't know how to show that. The continuity gives that $f^{-1}[\epsilon]$ is closed in $D$ for all $\epsilon > 0$ but can we say that it is also bounded under the above conditions?
 A: You can do this in 1D. Start with $y=x^2$, then cut it off by multiplying by $e^{-x^2}$. Then add $x^2\sin^2 x$. Voila. The function $f(x)=x^2e^{-x^2}+x^2\sin^2(x)$  is clearly non-negative, and is only zero at $x=0$. But for any $\varepsilon>0$ there there will be $N$ large enough that for any $x>N$ we have $x^2e^{-x^2}<\varepsilon$, while $x^2>\varepsilon$, so that the function will cross below and above $\varepsilon$ with every oscillation (i.e., at $x= \pi k$ the value is $x^2e^{-x^2}< \varepsilon$, at $x=\pi/2+\pi k$ the value is at least $x^2>\varepsilon$).
A: The statement is not true. Let us give a counterexample in ${\mathbb R}^2$ by defining a function in polar coordinates
\begin{equation}
f(x, y) = f(r \cos\theta, r\sin\theta) = \lambda(r) a(\theta) + \mu(r)
\end{equation}
Let us choose $a(\theta) = 2 + \sin \theta$, so that $a(\theta)$ takes any value in $[1, 3]$ when $\theta$ varies in $(-\pi, +\pi]$. Let us choose $\lambda(r)$ and $\mu(r)$ such that
\begin{equation}
\begin{array}\cr
\lambda(r) + \mu(r) = \displaystyle\frac{r}{1 +r^2}\cr
3 \lambda(r) +\mu(r) = r(1 + r^2)
\end{array}
\end{equation}
On the circle $C(0, r)$, $f$ takes all the values in $[\frac{r}{1+r^2}, r(1+r^2)]$, hence if $r$ is large enough, any given value $\epsilon > 0$ is reached on that circle.
