This may be too long for a comment. There is a proof under two lemmas: Lemma 1. (Partition of Unity) There is an increasing sequence of compact subspaces $X_1\subset ... \subset X_n \subset ...$ whose union is $X$, such that $X_n$ is in the interior of $X_{n+1}$. There is also a sequence of smooth functions $g_1, g_2, ... ,g_n, ...$ with values in $[0,1]$ such that $\text{supp}(g_1) \subset X_1$, $\text{supp}(g_2) \subset X_2$, and $\text{supp}(g_n)\subset \text{cl}(X_n-X_{n-2})$ for $n\geq3$, and $\underset{n=1}{\overset{\infty}{\sum}}g_n=1$. Lemma 2. (Good functions) There exists a smooth function $h_n$ on each $X_n$ such that $h_n$ and $f|_{X_n}$ have the same zeros, and $\frac{h_n}{f} \in [1/2,2]$ on $X_n$ whenever $|f| \geq 1/2^n$ or $|h_n| \geq 1/2^n$. **Proof.** Extend the domain of $h_n$ to the whole $X$ and let $g=\underset{n=1}{\overset{\infty}{\sum}}g_nh_{n+1}$. It's clear that the function $g$ is smooth and does not depend on how the $h_n$ are extended. Assume that the statement $\forall \epsilon>0. \exists \delta >0. \forall x \in X.(|f(x)|<\delta ⇒|g(x)|<\epsilon)$ is wrong, i.e. there exists an infinite sequence of points of $X$, $\{a_n\}$, such that $f(a_n) \rightarrow 0$ and $|g(a_n)|\geq \epsilon$. Take $m$ such that $\epsilon/2 \geq 1/2^m$. As there are only finitely many points of $\{a_n\}$ in $X_{m+2}$, we may assume that all the $a_n$s are outside $X_{m+2}$. Suppose $g(a_n) \geq \epsilon$. There are at most two nonzero summands in $\underset{k=1}{\overset{\infty}{\sum}}g_k(a_n)h_{k+1}(a_n)$, namely $g_k(a_n)h_{k+1}(a_n)$ and $g_{k+1}(a_n)h_{k+2}(a_n)$. As $a_n$ is outside $X_{m+2}$, we have $k\geq m$. By $g_k(a_n)+g_{k+1}(a_n)=1$, there is at least one of $h_{k+1}(a_n)$ and $h_{k+2}(a_n)$ that is larger than $\epsilon/2$. Call it $h_l(a_n)$. But by the definition of $h_l(a_n)$, we have $|f(a_n)| \geq |h_l(a_n)|/2 \geq \epsilon/4$. By replacing $g(a_n)\geq \epsilon$ by $g(a_n) \leq -\epsilon$, we have $|f(a_n)| \geq \epsilon/4$ whenever $|g(a_n)| \geq \epsilon$. Contradiction. Assume that the statement $\forall \epsilon>0. \exists \delta >0. \forall x \in X.(|g(x)|<\delta ⇒|f(x)|<\epsilon)$ is wrong, i.e. there exists an infinite sequence of points of $X$, $\{a_n\}$, such that $g(a_n) \rightarrow 0$ and $|f(a_n)|\geq \epsilon$. Take $m$ such that $\epsilon \geq 1/2^m$. As there are only finitely many points of $\{a_n\}$ in $X_{m+2}$, we may assume that all the $a_n$s are outside $X_{m+2}$. Suppose $f(a_n) \geq \epsilon$. There are at most two nonzero summands in $\underset{k=1}{\overset{\infty}{\sum}}g_k(a_n)h_{k+1}(a_n)$, namely $g_k(a_n)h_{k+1}(a_n)$ and $g_{k+1}(a_n)h_{k+2}(a_n)$. As $a_n$ is outside $X_{m+2}$, we have $k\geq m$. Both of $h_{k+1}(a_n)$ and $h_{k+2}(a_n)$ are larger than $f(a_n)/2$. So $g(a_n) \geq \epsilon/2$. By replacing $f(a_n)\geq \epsilon$ by $f(a_n) \leq -\epsilon$, we have $|g(a_n)| \geq \epsilon/2$ whenever $|f(a_n)| \geq \epsilon$. Contradiction. So $g$ satisfies both conditions.