Let $A$ be a subspace of a space $Y$, and let $f:A\to X$ be a continuous map. Then we can form the adjunction space $X\cup_f Y$. It is well-known that the natural map $X\to X\cup_f Y$ is a (closed) embedding (for example, Embedding into Adjunction space.), if $A$ is closed in $Y$.
My question is, Is the map $X\to X\cup_f Y$ an (not necessarily closed) embedding even if $A$ is not closed in $Y$? This seems true because the quotient map $X\cup Y\to X\cup_f Y$ doesn't identify any two distinct points in $X$. But I can't prove that this is indeed true.
Let $q:X\sqcup Y\to X\cup_f Y$ be the quotient map and let $C\subseteq X$ be any closed subset. Note that since $f$ is continuous, $f^{-1}(C)$ is closed in $A$, so there is a closed subset $D\subseteq Y$ such that $D\cap A=f^{-1}(C)$. Then $C\sqcup D\subseteq X\sqcup Y$ is a closed subset. Note moreover that $C\sqcup D$ is saturated with respect to the quotient map $q$ because $D\cap A=f^{-1}(C)$. Thus $q(C\sqcup D)$ is closed in $X\cup_f Y$, and its intersection with the copy of $X$ in $X\cup_f Y$ is just $C$. Thus $C$ is closed in the subspace topology on this copy of $X$. Since $C$ was an arbitrary closed subset of $X$, this proves the map $X\to X\cup_f Y$ is an embedding.