I am having some problems with the following proof:
$\textbf{Lemma: }$ Suppose $X$ is a topological space and $(h, Y), (g, Z)$ are (Hausdorff) compactifications of $X$.
That is, $Y$ compact Hausdorff, $h$ a homeomorphic embedding such that $h(X)$ is dense in $Y$ and similarly for $(g, Z)$.
If $(h, Y) \le (g,Z)$ is realised by $\pi:Z \to Y$ then $\pi(Z\setminus g(X)) = Y\setminus h(X)$
$\textbf{Proof:}$ One can prove fairly easily that $\pi$ is surjective.
We have that if $A \subset Z$ then $g(X)\cap A = g(g^{-1}(A))$
If $z \in Z\setminus g(X)$ is such that $\pi(z) \in h(X)$ we fix $x \in X$ such that $\pi(z) = h(x)$.
Since $z\ne g(x)$ we can find open $U$ with $x \in U$ and $g(x) \not \in \overline{U}$ (Hausdorffness).
Since $g(X)$ is dense in $Z$, $z \in \overline{U\cap g(X)} $ and $g(x) \not \in \overline{U \cap g(X)}$
Then $x\not \in \overline{g^{-1}(U)}$ (since if $x \in \overline{g^{-1}(U)}$ then $g(x) \in g(\overline{g^{-1}(U)})\subset \overline{g(g^{-1}(U))}=\overline{U\cap g(X)}$
$\bbox[lightyellow]{\text{Now the part I have a problem with, it is claimed that, since } h \text{ is a homeomorphic embedding:}}$ $\bbox[lightyellow]{h(x) \not \in \overline{h(g^{-1}(U))}^{h(X)}=h(X)\cap \overline{h(g^{-1}(U))}^Y}$
If this indeed the case then since $\pi \circ g = h$ we have:
$h(x)=\pi(z) \in \pi(\overline{U\cap g(X)}) \subset\overline{\pi(U \cap g(X))} =\overline{\pi(g(g^{-1}(U)))} = \overline{h(g^{-1}(U))}$
Which is the required contradiction.
$\textbf{My attempt at the highlighted:}$
I know that $h(x) \not \in h(\overline{g^{-1}(U)})$ since if it were;
Then $\exists x_2 \in\overline{g^{-1}(U)}$ such that $h(x)=h(x_2)$ but by injectivity $x = x_2 \in \overline{g^{-1}(U)}$ which we know is not the case.
However I am not sure how I can conclude that $h(x) \not \in \overline{h(g^{-1}(U))}$