The quotient relation of adjunction of two Hausdorff spaces is closed I have the following:
$X$ and $Y$ are Hausdorff spaces, $A \subseteq X$ is closed, $f:A\rightarrow Y$ is continuous. $X \cup Y$ is a topological space in which $X$ and $Y$ are both open and closed carrying their original topologies. $\sim$ is the least equivalence relation on $X \cup Y$ such that $x\sim f(x)$ for all $x \in A$.
I am asked to show that $\sim$ is a closed relation.
So far I know that $\sim$ is a closed relation only if the set: $\{(x,y):x\sim y\}$ is closed.
$x\sim y$ has three possible cased:
$y = f(x)$ if $x \in A$.  So we have $x\sim ~f(x)$
$y=x$ if $x \notin A$ and $x \in X$. So we have $x\sim x$
$x = y$ if $y \notin A$ and $ y\in Y$. So we have $y\sim ~y$.
I think this means $\{(x,y): x\sim y\} = (A\times f(A)) 
\cup \{(x,x) :x \in X-A\}\cup\{(y,y) :x \in Y-f(A)\}$
The first set in the union is closed since $A$ is closed, and the image of a compact set in a Hausdorff space is closed.
I am not sure why the second and third set should be closed.
Thanks!
Edit: I have adjusted my argument based on Tyrone's comment below.
The set {(x,y): x~y} = $B_1 \cup B_2 \cup \Delta X \cup \Delta Y $
Where:
$B_1 =$ {$(a, f(a)) \in X \times X : a\in A $} is closed since A is closed, f is continuous, and in a Hausdorff space the graph of. a continuous function over a closed set is closed.
$B_2 = $ {$(f(a),a) \in Y \times X : a \in A$} is closed for the same reason.
$\Delta X$ is the diagonal of X which is closed in a Hausdorff space
and $\Delta Y$ is the diagonal of Y which is closed in a Hausdorff space.
So {$(x,y) : x~y$} can be written as a finite union of closed sets. Hence is closed. Therefore ~ is a closed relation.
 A: Your argument looks ok, but you should be a bit more careful about where these sets actually live, because you've written $\Delta X$ for the diagonal of $X$, but the relation set 
$$ R = \{(z, z')\ |\ z \sim z'\}$$
is really a subspace of $(X\sqcup Y)\times (X\sqcup Y)$. Thankfully this product of disjoint unions splits into disjoint components
$$ (X\sqcup Y)\times (X\sqcup Y) \cong (X\times X) \sqcup (X\times Y) \sqcup (Y\times X) \sqcup (Y \times Y)$$ so your piecewise arguments carry forward to the full space. In particular, since $\Delta X$ and $\Delta Y$ are closed in $X\times X$ and $Y\times Y$ respectively, it follows that they are closed in $(X\sqcup Y)\times (X\sqcup Y)$. In fact 
$$"\Delta X" \cup "\Delta Y" = \Delta(X \sqcup Y) $$
which is closed because $X\sqcup Y$ is Hausdorff.
We also see that $B_1 :=\{(x, f(x))\in (X\sqcup Y)\times (X\sqcup Y)\ |\ x\in A\}$ is closed in $(X\sqcup Y)\times (X\sqcup Y)$ as well as the space $B_2 :=\{(f(x),x)\}$. You've already mentioned the relevant result: if $A\subset X$ is closed and $f\colon A\to Y$ is continuous for $Y$ Hausdorff, then the graph $\Gamma\subset A\times Y \subset X\times Y$ is closed. Since $X\times Y$ is a component of $(X\sqcup Y)\times (X\sqcup Y)$ the graph is also closed in the space where we need it to be. Then $B_2$ is also closed in $Y\times X$ since it is the image of $B_1$ under the homeomorphism that swaps coordinates, and so we've proven that the $R$ is closed in $(X\sqcup Y)\times (X\sqcup Y)$.
