Consider a path-connected topological space $X$, to which we attach a $1-$cell via the map $\phi:S^0 \to X$, where $S^0 = \{-1,1 \}$. The space we obtain is $$Y = (X \sqcup [-1,1]) / \{-1 \sim \phi(-1) \text{ and } 1 \sim \phi(1) \}. $$
How can we prove that the inclusion $i:X \hookrightarrow{} Y$ induces an injective homomorphism $i_*:\pi_1(X,p) \to \pi_1(Y,p)$ for every $p \in X$?
Intuitively, I see that the attaching a $1-$cell to the space $X$ is similar to $X \lor S^1$ (in the case that we can deformation retract the path between $\phi(1)$ to $\phi(-1)$ in $X$ to a point), so the fundamental group of $Y$ is $\pi_1(X) * \mathbb{Z}$. But what if we cannot deformation retract this path to a point? Also, how do we specifically prove that the inclusion induces an injective homomorphism (we know that it always is a homomorphism); computing the fundamental group of $Y$ using the theorem of Seifert-van Kampen doesn't seem to suffice.
As $X$ is path connected, we can define a continuous map $f\colon Y\to X$ that is the identity on $X$ and maps the glued cell to a path in $X$ between the glue points. Now consider a loop that is in the kernel of $i_*$ and apply $f$ to the corresponding homotopy.