Zeroes of a continuous function on a metric space
Let $f$ be a continuous real valued function on a metric space $X$. Let $Z(f)$ be the set of all $p\in X$ such that $f(p)=0$
$\text{(a)}$ Prove that $Z(f)$ is closed.
$\text{(b)}$ Recall that for a set $E \subset X$ the distance from a point to this set is defined as $$h(x)=\inf_{s\in E}d(x,s)$$ Prove that $h$ is uniformly continuous.
$\text{(c)}$ Use the previous part to show that for any closed set $E\subset X$ there exist a continuous function $f:X\to\Bbb{R}$ that is $0$ on $E$ and positive elsewhere.
Let $f$ be a continuous real valued function on a metric space $X$. Let $Z(f)$ be
the set of all $p\in X$ such that $f(p)=0$.
a) Prove that $Z(f)$ is closed.
b) Recall that for a set $E \subset X$ the distance from a point to this set is defined
as
$$h(x)=\inf_{s\in E}d(x,s).$$
Prove that $h$ is uniformly continuous.
c) Use the previous part to show that for any closed set $E \subset X$ there exist a
continuous function $f \colon X \to \mathbb R$ that is $0$ on $E$ and positive elsewhere.
For (a), I think the set $\lbrace0 \rbrace$ is a finite set, which means it is a closed set. By the theorem that a mapping $f$ of a metric space $X$ into a metric space $Y$ is continuous if and only if $f^{-1}(C)$ is closed for very closed set $C$ in $Y$, $Z(f)$ should be also closed. Is this correct?
I'm not sure how to solve b) and c) at all though. Maybe I can use that $\lvert h(x)-h(y) \rvert \leqslant \lvert d(x,y)\rvert$?
Could you help me solve this problem?
Thank you!
Solution 1:
Your answer to (a) is fine.
For (b) note that $|h(x)-h(y)|\le d(x,y)$. EDIT: The problem statement misses the necessary conditin that $E\ne\emptyset$. With $E=\emptyset$, we would have $h(x)=\infty$ with some good will, but not a real-valued function.
For (c) note that the $h$ defined in (b) has this property: Trivially $h(x)=0$ for $x\in E$; why is $h(x)>0$ for all $x\notin E$? EDIT: Note that in the light of (a), the condition that $E$ is closed is necessary. If $E=\emptyset$, we cannot make use of the function in (b), but letting $h(x)=1$ helps.