Let $f:A\to X$ be a continuous injective map of spaces. Let $g:A\to Y$ be continuous. Prove that the map $i_Y:Y\to X\cup_A Y$ is injective. Here, $X\cup_A Y:=X\coprod Y/\sim$, where $\sim$ is the finest equivalence relation such that $f(a)\sim g(a)$. This is called the pushout of $X$ and $Y$ along $A$. Also, the map $i_Y$ is defined as the composition of the inclusion $X\to X\coprod Y$ with the quotient map $X\coprod Y\to X\coprod Y/\sim$.
I'm new to the idea of pushouts, so I'm having a hard time getting started here. I know that we have the "diagram commutativity" relation $i_X\circ f=i_Y\circ g$ where the definition of $i_X$ is analogous to the definition of $i_Y$, but I'm not sure how to use this. My first thought was to just jump in and try to prove this using the definition of injective as follows.
Pick $y_1,y_2\in Y$ such that $i_Y(y_1)=i_Y(y_2)$. A first case I tried considering was when $y_1=g(a_1)$ and $y_2=g(a_2)$ for some $a_1,a_2\in A$. Then we have (using $[-]$ to denote eq. class), $$ [f(a_2)]=[g(a_2)]=i_Y(y_2)=i_Y(y_1)=[g(a_1)]=[f(a_1)], $$ and then the injectivity of $f$ implies $a_1=a_2$? I'm not sure here. Also, what about the cases when $y_1$ and $y_2$ are not in the image of $g$?
Any suggestions? Am I approaching this right?