Question on compactification of a space. 
Let $X$ be a compact Hausdorff space and $A \subseteq X$ be closed. Then show that one point compactification of $X \setminus A$ is homeomorphic to $X / A.$

$\textbf {My attempt} :$
What we know is that one point compactification of $X \setminus A$ is nothing but the space $Y = (X \setminus A) \cup \{\infty\}$ equipped with the topology $\tau_Y = \tau_1 \cup \tau_2,$ where $\tau_1$ is the topology on $X \setminus A$ and $\tau_2$ is given by $$\tau_2 : = \{Y \setminus C\ |\ C \subseteq X \setminus A\ \text {is compact} \}.$$ It is clear that as a set $X / A$ and $Y$ are in a bijective correspondence. There are obvious natural embeddings of $X \setminus A$ into the spaces $X / A$ and $Y$ and it is clear that both the spaces can be obtained by adjoining one single point to $X \setminus A$ (when viewed in terms of the embeddings). So in order to prove $Y$ is homeomorphic to $X/A$ it is enough to show that $X/A$ is compact and Hausdorff. Compactness of $X/A$ is clear as it is the image of the compact set $X$ under the quotient map $p : X \longrightarrow X/A.$ Also since $X$ is compact and Hausdorff it is normal and hence regular in particular and since $A \subseteq X$ is closed it follows that $X / A$ is Hausdorff. This proves the result.
Would anybody please have a look at my solution and check whether it holds good or not?
Thanks for reading.
 A: We need to also assume that $A$ is not open. Let $x\in X\setminus A$, then since $X$ is compact Hausdorff, and $x\notin A$, there is a neighbourhood $U$ of $x$ whose closure is disjoint from $A$ and is compact (follows from the regularity of $X$). So, $X\setminus A$ is locally compact, Haudorff.
The restriction of the quotient map $q\colon X\to X/A$ to $X\setminus A$ is an injective continuous map whose image misses the point corresponding to $A$. Moreover, the closure of this image is $X/A$ because $A$ is not open (else $X\setminus A$ is already compact).
Being the continuous image of a compact set, $X/A$ is compact and by regularity of $X$, it is Hausdorff. By the uniqueness of one point compactification, $X/A$ is the one point compactification of $X\setminus A$.
A: Let us denote the one point compactification of $X \setminus A$ by $(X \setminus A)^{+}.$ Now consider the map $f : X \longrightarrow (X \setminus A)^{+}$ defined by $$f(x) = \begin {cases} x\ & \text {if}\ x \in X \setminus A \\ \infty\ & \text {if}\ x \in A \end {cases}$$ Claim $:$ $f$ is continuous.
Case 1 $:$ Let $U \subseteq_{\text {open}} (X \setminus A)^{+}$ such that $\infty \notin U.$ Then $U \subseteq_{\text {open}} X \setminus A.$ Since $U$ is open in $X \setminus A$ and $X \setminus A$ is open in $X$ (because $A$ is closed in $X$) we have that $U$ is open in $X.$ Also since $f \big \rvert_{X \setminus A} = \text {Id}_{X \setminus A}$ it follows that $f^{-1} (U) = U.$ So we are through in this case.
Case 2 $:$ Let $U \subseteq_{\text {open}} (X \setminus A)^{+}$ such that $\infty \in U.$ Then $(X \setminus A)^{+} \setminus U$ is a compact subset of $X \setminus A$ and hence a compact subset of $X$ and thus it is closed in $X$ (because $X$ is Hausdorff). But on the other hand since $(X \setminus A)^{+} \setminus U \subseteq X \setminus A$ and $f \big \rvert_{X \setminus A} = \text {Id}_{X \setminus A}$ it follows that $$(X \setminus A)^{+} \setminus U = f^{-1} ((X \setminus A)^{+} \setminus U) = X \setminus f^{-1} (U).$$ Thus we have $X \setminus f^{-1} (U)$ is closed in $X$ or in other words $f^{-1} (U)$ is open in $X.$
This proves our claim.
Now by universal property of quotient topology $f$ induces a bijective continuous map $\widetilde {f} : X/A \longrightarrow (X \setminus A)^{+}.$ But since $X/A$ is compact and $(X \setminus A)^{+}$ is Hausdorff (by definition) it follows that $\widetilde {f}$ is a homeomorphism.
This completes the proof.
