Show that the Quotient map is closed. 
Let $X$ and $Y$ be topological spaces. Let $X \cup Y$ be the space with disjoint union topology.Suppose $A \subset X, A $ closed, $f : A \to Y$ be a continuous closed map.Consider the quotient map $\pi: X \cup Y \to X \cup _{f} Y$.Then $\pi$ is closed map.

I am trying to prove using the definitions directly but its getting bit messy.Is there any 'smart' way to prove $\pi$ is closed?
 A: In the following diagram let the map $A \hookrightarrow X$ and the maps to $X \cup Y$ be the inclusions. The maps $\bar f$ and $j: Y \hookrightarrow X \cup_f Y$ send a point to its equivalence class, so the outer rectangle and the triangles commute. Note that closedness of $\pi$ is equivalent to closedness of both $\bar f$ and $j$, so showing that each of these two maps is closed is maybe less messy.

Consider closed sets $B \subseteq X$ and $C\subseteq Y$. You need to show that $\pi^{-1}(\bar f(B))$ and $\pi^{-1}(j(C))$ are closed in $X \cup Y$. For either set, there exists a simple formula from which you should see, using closedness of $A$ and of $f$ whenever needed, that the set is closed. Can you find them? Let me know if you struggle and I'll provide some hints.
A: I would just follow the definitions. Suppose that $F\subseteq X\cup Y$ is closed. Then $F$ is the disjoint union of the sets $F_0=(F\cap X)\setminus A$, $F_1=F\cap A$, $F_2=(F\cap Y)\setminus f[A]$, and $F_3=F\cap f[A]$.


*

*Show that $\pi^{-1}[\{\pi(z)\}]=\{z\}$ if $z\in F_0\cup F_2$.  

*Show that $\pi^{-1}[\{\pi(z)\}]=f^{-1}[\{f(z)\}]\cup\{f(z)\}$ if $z\in F_1$.  

*Show that $\pi^{-1}[\{\pi(z)\}]=f^{-1}[\{z\}]\cup\{z\}$ if $z\in F_3$.  

*Conclude that $\pi^{-1}\big[\pi[F]\big]=F\cup f^{-1}\big[f[F\cap X]\big]\cup f^{-1}[F\cap Y]$, which is closed (why?).

