Attaching spaces hausdorff property and compactness Suppose $X, Y$ are Hausdorff space and $A\subseteq Y$ is compact. Suppose $f:A\rightarrow X$ is continuous. Show that
(1) The canonical projection $q:X\coprod Y\rightarrow X\cup_f Y$ is closed
(2) If $z\in X\cup_f Y$ then $q^{-1}(z)$ is compact in $X\coprod Y$.
I've been playing around with this, and for (1), all I can get is that if $\sigma: X\rightarrow X\coprod Y$ is the canonical injection, then $q\circ \sigma$ is a closed map, and similarly, if $\sigma': Y\backslash A\rightarrow X\coprod Y$ is the canonical injection then $q\circ \sigma'$ is an embedding with the open image. I'm not sure what else to say. Is there a slick way to solve this problem?
Note that $X\coprod Y$ is equipped with the disjoint union topology (final topology)

Showing that $q$ is closed.
A set $F\subset X\sqcup Y$ is closed iff both $i_{X}^{-1}(F)\subset X$ and $i_{Y}^{-1}(F)\subset Y$ are closed. Here $i_{X}$ and $i_{Y}$ are the canonical inclusion maps. Both maps are closed maps as can be checked: As $i^{-1}_{X}(i_{X}(F))=F$ and $i^{-1}_{Y}(i_{X}(F))=\varnothing$, both sets are closed in their respective spaces, and hence $i_{X}(F)$ is closed in $X\sqcup Y$. A similar argument shows $i_{Y}$ is closed. Similarly, a set $F\subset X\cup_{f}Y$ is closed iff $q^{-1}(F)$ is closed. This is the definition of the quotient topology.
Let $F\subset X\sqcup Y$ be a closed set and let $F_X$ and $F_Y$ be the two closed sets $F\cap i_{X}(X)$ and $F\cap i_{Y}(Y)$ respectively. We wish to show that $q^{-1}(q(F))$ is a closed set, as that would imply that $q(F)$ is closed. Further, as $F = F_X\cup F_Y$ we have that $q(F_X\cup F_Y) = q(F_X)\cup q(F_Y)$ and therefore $q^{-1}(q(F)) = q^{-1}(q(F_X))\cup q^{-1}(q(F_Y)) $. So it suffices to show both $q^{-1}(q(F_Y))$ and $q^{-1}(q(F_Y))$ are closed. As $F_Y \subset Y$, $F_Y\cap A$ is compact and since $X$ is Hausdorff, $f(F_Y\cap A)$ is closed in X. Now one can check that $q^{-1}(q(F_{Y}))=F_Y\cup f^{-1}(f(F_Y\cap A))\cup f(F_Y\cap A) $, which is closed. Lastly, $q^{-1}(q(F_X))=F_X\cup f^{-1}(F_X\cap f(A))$. Again $F_X\cap F(A)$ is compact and hence closed in $X$ and thus it's preimage is closed in $Y$.
Showing that $q^{-1}(z)$ is compact.
First, note that if $q^{-1}(z)\cap (f(A)\cup A)=\varnothing$, then it's a single point. Points are trivially compact in Hausdorff spaces. So, assume this isn't the case. Now, as $f$ is a function, there can be only one point $x\in X$ such that $q(x) = z$. Further, $x$ must be in $f(A)$ by our assumption. Now $f^{-1}(x)\subset A$ and as $A$ is compact $f^{-1}(x)$ is compact. Thus $q^{-1}(z) = \{x\} \cup f^{-1}(x)$ which is the union of two compact sets, and hence is compact.
