I want to solve the following exercise:
Exercise
Suppose that $ X $ and $ Y $ are compact Hausdorff topological spaces and $ A \subset Y $ is non-empty and closed. Let $ x_0 \in X $ be a point. Prove that if $ \varphi \colon X \setminus \{ x_0 \} \to Y \setminus A $ is a homeomorphism, then there exists a homeomorphism $ f \colon X \to Y / A $.
I think that I can intuitively see why this is true, but I cannot formally prove this statement.
My attempt
Let $ f $ be given by $$ f(x) = \begin{cases} (q \circ \varphi)(x) &\text{ if } x \neq x_0 \, , \\ a &\text{ otherwise} \, , \end{cases} $$ where $ q \colon Y \to Y / A $ is the quotient map and $ a \in q(A) \subset Y / A $ is a fixed point. Since $ \varphi $ and $ q \colon Y \setminus A \to Y / A $ are homeomorphisms (we restricted $ q $ to $ Y \setminus A $ - this is a homeomorphism onto its image), we know that $ f $ is a bijection. We need to prove that $ f(U) $ is open for any open $ U \subset X $ and $ f^{-1}(O) $ is open for any open $ O \subset Y / A $. Let $ U \subset X $. If $ x_0 \not \in U $, then $ f(U) $ is clearly open in $ Y / A $, because $ f(U) = (q \circ \varphi)(U) $. If $ x_0 \in U $, then $$ f(U) = f(U \setminus \{ x_0 \}) \cup f(\{ x_0 \}) = (q \circ \varphi)(U \setminus \{ x_0 \}) \cup \{ a \} \, . $$ Let $ f(U) = W $. We know that $ W $ is open if and only if $ q^{-1}(W) = \varphi(U \setminus \{ x_0 \}) \cup A $ is open.
I don't know how to proceed from here. Similarly, I do not know how to prove $ f^{-1}(O) $ is open given an open $ O \subset Y / A $ such that $ a \in O $, but it seems to me that the proof must use a very similar argument. I imagine we now need to use the compactness of $ X $, $ Y $, and $ A $ somehow, but I've no idea how.