TITLE: Map from free product $G*G$ to $G$
QUESTION [5 upvotes]: Disclaimer: This came up in working on a homework problem, but this is just my curiosity and won't actually help me solve the homework problem, probably.
Let $G$ be a group, and take the free product $G*G$. Define $\phi:G*G \to G$ by taking words in $G*G$ and actually reducing them by multiplication in $G$. Is this a group homomorphism? Is there a canonical name for this homomorphism?
Both of the following discuss related questions, but I don't think either discusses my exact question.
free product of the same group
Finitely generated free group is a cogroup object in the category of groups

REPLY [5 votes]: The free product is the coproduct in the category of groups, and so it enjoys the following universal property:

If $G_1$ and $G_2$ are groups, and $\phi_1:G_1\to H$ and $\phi_2:G_2\to H$ are group homomorphisms, then there exists a unique homomorphism
  $$\phi_1\ast\phi_2:G_1\ast G_2\to H$$
  such that $(\phi_1\ast\phi_2)\circ i_j= \phi_j$ for $j=1,2$, where 
  $$i_1:G_1\to G_1\ast G_2\quad\text{and}\quad i_2:G_2\to G_1\ast G_2$$
  are the obvious inclusions. 

As an example, if $a_1b_2a_2b_1\in G_1\ast G_2$, with $a_i,b_i\in G_i$, then 
$$(\phi_1\ast\phi_2)(a_1b_2b_1a_2) = \phi_1(a_1)\phi_2(b_2)\phi_1(b_1)\phi_2(a_2) = (\phi_1\ast\phi_2)(a_1b_2)\cdot (\phi_1\ast\phi_2)(b_1a_2)$$
Your case is $\phi_1=\phi_2=id_G:G\to G$.
In general, for any category $\mathcal{C}$ with coproduct $\amalg$, there is a "folding map" for all objects $X$:
$$id_X\amalg id_X:X\amalg X\to X$$
induced by the identity map $id_X:X\to X$.