Let $(Z,W)$ be a compact Hausdorff space and $\tilde X\subseteq Z$ an open subset of $Z$.
Furthermore let $h:(\tilde X, W_{|\tilde X}) \to (X, \mathcal T)$ be a homeomorphism.
$Y:=X \cup \{\infty\}$
How can I show that $f: Z \to Y, f(x)=h(x)$ for $x \in \tilde X$ and $f(z)=\infty$ for $z \in Z\setminus\tilde X$ is continuous?
$h$ is a homeomorphism, so $f$ is continuous on $\tilde X$. And $f$ is constant on $Z\setminus \tilde X$ so $f$ is continuous on $Z\setminus \tilde X$. But how do I show that $f$ is continuous on $Z$ as a whole?
You need to prove that for any open subset $U$ of $Y$ containing $\infty$, $f^{-1}(U)$ is an open subset of $Z$.
An open subset $U$ of $Y$ containing $\infty$ can be written as a $Y \backslash K$, where $K$ is a compact subset of $X$.
So $f^{-1}(U) = Z \backslash h^{-1}(K)$ and you can do the rest.