# Attaching spaces and quotient maps

Let $$q:X\coprod Y \rightarrow X\coprod Y\backslash \sim$$ be the quotient map, where $$X\coprod Y\backslash \sim$$ is the quotient space and $$f:A\subseteq Y \rightarrow X$$ is the attaching map. Note $$\sim$$ is the equivalence relation generated by $$a\sim f(a)$$ for all $$a\in A$$, where $$A$$ is a closed subspace of $$Y$$.

How do I show that $$q|_X$$ is injective?

$$X\coprod Y/\backslash\sim$$ $$=X-A\coprod Y-f(A)\coprod\{(a,f(a)),a\in A\}$$,
$$q(x)=x$$ if $$x\in X-A$$, $$q(x)=(x,f(x))$$ if $$x\in A$$. Suppose that $$q(x)=q(y)$$. If $$x,y\in X-A, q(x)=x=q(y)=y$$. If $$x\in X-A, y\in A q(x)$$ and $$q(y)$$ are in disjoint subsets impossible. If $$x,y\in A, (x,f(x))=(y,f(y))$$ implies that $$x=y$$.
The equivalence relation determines a partition of $$X \coprod Y$$ into equivalence classes. These are the sets $$A(x) = \{x \} \coprod f^{-1}(x)$$ for $$x \in X$$ and $$\{y\}$$ for $$y \in Y \setminus A$$. Note that $$A(x) = \{x\}$$ if $$x \notin f(A)$$. We have $$q \mid_X (x) = A(x)$$. Now assume $$A(x) = A(x')$$. Then $$\{ x \} = A(x) \cap X = A(x') \cap X = \{ x'\}$$. Thus $$x = x'$$.