I have been working on a question with two parts. PART ONE
Let $(X, \tau_x)$ and $(Y,\tau_Y)$ be topological spaces and $A\subset X$ a subset. Define an equivalence relation $\sim$ on $X$ by $x \sim y$ if and only if $x=y$ or $x,y, \in A$.
Let $X/A$ be the quotient $X/\sim$ equipped with the quotient topology, denoted simply by $\tau$ and let $p: X\to X/A$ be the resulting map. Let $f: X\to Y$ be a continuous map such that $f(A)=\{ f(a): a\in A\}$ has exactly one element. Show that there exists a unique continuous map: $$g: X/A \to Y \quad \text{ with } f= g \circ p.$$
I derived here that the desired property essentially fixes our map (giving us uniqueness) for $x \in X$: $$ f(x)= (g \circ p)(x)= g(p(x))= g([x]) \implies g([x])=f(x).$$ Well-definedness follows from the fact that $|f(A)|=1$, so if $x\sim x$ we have $g([x])=f(x)$ and $g([x'])=f(x')$. Now by $x \sim x'$ either $x=x'$ or $x,x'\in A$ we see that since $|f(A)|=1$ in both cases $f(x)=f(x')$ hence the map is well-defined. (Now we also have existence, since by construction it satisfies the property).
I can then use a lemma in the book, since $f$ is continuous and $p$ is the canonical projection, hence surjective, we have that $g$ is continuous. END OF FIRST PART.
Now for the difficult part, part 2. This exercise proves a universal property. The claim is that this universal property uniquely determines the quotient.
We wish to show that this last property determines $X/A$ uniquely as follows:
Let $(Q, \tau_Q)$ be another topological space with a continuous map $q: X \to Q$ such that $q(A)$ has exactly one element and the following property: for any continuous map $f : X \to Y$ such that $f(A)$ has exactly one element, there exists a unique continuous map $g: Q \to Y$ such that $f = g \circ q$.
Show that there is a unique homeomorphism $\phi: Q \to X/A$ such that $\phi \circ q = p$.
I understand that what we want to show is that in a way all the conditions fix $Q$ to be the same quotient as $X/A$. To show that two spaces are homeomorphic we need to construct a map that is a bijection and also continuous with continuous inverse map. I cannot find a good way to construct this $\phi$ however. Does anyone have a good candidate?

HINT: Take $Y=X/A$ and $f=p$ to see that there is a unique continuous $h:Q\to X/A$ such that $p=h\circ q$; this is your candidate for $\varphi$. Then take $Y=Q$ and $f=q$ to see that there is a unique continuous $\hat h:X/A\to Q$ such that $q=\hat h\circ p$. Note that $p=h\circ q=h\circ\hat h\circ p$, and $q=\hat h\circ p=\hat h\circ h\circ q$.