TITLE: free product with amalgamation is correspondingly a pushout
QUESTION [5 upvotes]: I'm trying to proof that the following diagram in the category of groups with $i_1$ and $i_2$ being inclusions is a pushout iff $G$ is the free product with amalgamation (up to isomorphism). It should be sufficient to proof $"\Leftarrow"$ since the pushout is unique up to isomorphism. How does the proof of $"\Leftarrow"$ go?
\begin{array}{ccc} 
G_0 & \xrightarrow{i_1} & G_1 \\
\downarrow_{i_2} &  & \downarrow_{\varphi_1}\\
G_2 & \xrightarrow{\varphi_2} & G
\end{array}
I tried defining the unique homomorphism of the pushout by
$$\phi((g_1*...*g_n)N) = h_i(g_1)*...*h_i(g_n)$$
but couldn't proof it's well-definedness.

REPLY [6 votes]: Just think of $i_1$ and $i_2$ as inclusion, even so there are not necessarily. Given two maps $h_i \colon G_i \to H, i \in \{1,2\}$, there is an induced one $h \colon  G_1 \ast G_2 \to H$ defined as $h_i$ when restricting to the letters of $G_i$. (This is clearly well-defined.)
Now, what happens when $h_1$ and $h_2$ agree on $G_0$ ? It means that $h_1(x)=h_2(x)$ for any $x \in G_0$. In other word, $\ker (h)$ contains all the $x^{(1)}\ast{x^{(2)}}^{-1}$ for $x \in G_0$ (where the parenthesized exponent indicates where the letter $x$ comes from) and so also the normal subgroup generated by those. It exactly means that you can factor $h$ by the quotient
$$ G_1 \ast_{G_0} G_2 = (G_1 \ast G_2) \mathop{\big/} \left\langle g \left(x^{(1)}\ast {x^{(2)}}^{-1}\right)g^{-1} : x\in G_0, g \in G_1 \ast G_2 \right\rangle .$$
QED.

Now just do the same but taking into account $i_1,i_2$. Hint : it does not change much !