Show that the Quotient map is closed.
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.
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?).