# Completely regular space is hereditary

So I look online that the definition of the completely regular if whenever $E\subset X$ is closed and $x\notin E$ there is a continuous function $f:X\to [0,1]$ such that $f(x)=0$, and $f(E)=\{1\}$.

Now, on a "fact", they also say they the Tychonoff space is hereditary property. Now, I think that this follows from the fact that Tychonoff space is completely regular. So how do I show that completely regular space is hereditary if that's the case?

Let $X$ be completely regular, and let $Y\subseteq X$ be a subspace with the relative topology. Suppose that $F\subseteq Y$ is closed in $Y$ and $x\in Y\setminus F$. Then $x\notin\operatorname{cl}_XF$, so by complete regularity of $X$ there is a continuous $f:X\to[0,1]$ such that $f(x)=0$ and $f[\operatorname{cl}_XF]=\{1\}$. Now let $g=f\upharpoonright Y$, the restriction of $f$ to $Y$; $g:Y\to[0,1]$ is continuous, $g(x)=0$, and $g[F]=\{1\}$. Thus, $Y$ is completely regular.

There is an alternative proof that relies on another characterization of complete regularity with the advantage of being utterly trivial. Kopperman, in "all topologies come from generalized metrics", American Mathematical Monthly, 1988, proves that allowing a metric to take values in a value semigroup and dropping the symmetry condition makes every topological spaces metrizable. Moreover, the completely regular spaces are precisely those that can be metrized by a symmetric such metric. The subspace topology is metrized in the obvious way. So, the fact that a subspace of a completely regular space is completely regular becomes the evident fact that a subspace of a symmetric metric space is still a symmetric metric space.