Show that completely regular is a topological property Show that completely regular is a topological property.

Let $ X $ be a completely regular space and let $ h:X \rightarrow Y $ a homeomorphism. We will prove that $ Y $ is completely regular.

My Attempt
Suppose that $ C $ is a closed subset of $ Y $ and that $ y \in Y \setminus C $ is an arbitrary point. Then, there exists $ x \in X $ such that $ h(x) = y $ and $ x \not\in h^{-1}(C) $. Since $ h $ is continuous, $ h^{-1}(C) $ is closed in $ X $.
Since $ X $ is completely regular, there is a continuous function $ f $ such that $ f(x) = f(h^{-1}(y)) = 0 $ and $ f(h^{-1}(C)) = 1 $. Thus, $ Y $ is completely regular.
I'm not sure of the proof, mainly of the last two lines.

To prove $Y$ is completely regular, you need to prove there exists a continuous function $g:Y\to [0,1]$ such such that $g(y)=0$ and $g(c)=1$ for all $c\in C$.  You haven't actually exhibited such a function, so you haven't proved that $Y$ is completely regular.  However, you've done most of the work needed to do so.  Based on what you have, what could you define $g$ as?
