Consider the group $G=\langle x\_1,x\_2,x\_3|x\_1^2,x\_2^2,x\_3^2\rangle$. Using a slightly modified version of S. Ivanov's proof [here](https://mathoverflow.net/questions/20471/why-are-free-groups-residually-finite) that free groups are residually finite, I can show that this group is residually finite. Since it is clearly finitely generated, this implies it is Hopfian.


**Proof:** Let $x\_{i\_n}\cdots x\_{i\_1}$ be a reduced word in $G$, so $i\_k\ne i\_{k+1}$ for any $1\le k\le n$. Define $f\_1,f\_2,f\_3\in S\_{n+1}$ as follows. For $1\le k\le n$, let $f\_{i\_k}(k)=k+1$ and $f\_{i\_k}(k+1)=k$, which is well-defined as $i\_{k+1}\ne i\_k$, and let each $f\_i$ fix every other element of $\{1,\ldots,n+1\}$. Then each $f\_i^2=\mathrm{id}$, so $f:G\to S\_{n+1}$ defined by $f(x\_i)=f\_i$ is a homomorphism, and $f(x\_{i\_n}\cdots x\_{i\_1})(1)=f\_{i\_n}\circ\cdots\circ f\_{i\_1}(1)=n+1$ hence is nontrivial. Thus $G$ is residually finite.


However, I find this proof rather unsatisfying, in part because in the context where $G$ arises I don't see a natural interpretation of residual finitude. Is there a more direct way to prove that $G$ is Hopfian, perhaps analogous to direct proofs that finitely generated free groups are Hopfian (see for example prop. 3.5 of [Combinatorial Group Theory](http://books.google.com/books?id=aiPVBygHi_oC&printsec=frontcover#v=onepage&q&f=false) by Lyndon & Schupp)?



Direct proof that a group is Hopfian
Here are the details for my comment with a "direct proof" (by reduction to the free group case) of Hopfian property for groups $G=H\_1\*...\*H\_k$, where each $H\_i$ is a finite group, say, $Z\_2$ in OP's question. (Note that I did not claim that such reduction holds in general, Yves constructed a nice counter-example to such a claim, see his comment above.) 


Let $f: G\to G$ be an epimorphism. Every finite order element of $G$ is conjugate to one of the subgroups $H\_i$. I claim that kernel of $f$ is torsion-free: Otherwise consider the projection
$$
\bar{f}: \bar{G}=H\_1\times ...\times H\_k \to \bar{G}. 
$$ 
Then $\bar{f}$ is surjective and not injective homomorphism of finite groups, which is impossible. 


Let $F\subset G$ be a free subgroup of finite index, let $F'=f^{-1}(F)$. By the above observation, $F'$ is also torsion-free, hence, free. Clearly, $i=|G:F|=|G:F'|$. Therefore,
$$
\chi(F)=\chi(F')= i\chi(G).
$$
Here I am using the virtual Euler characteristic $\chi(K)$ of groups $K$, which is also the Euler characteristic of the suitable hyperbolic orbifold $O$ so that $K=\pi\_1(O)$. 


Since both $F, F'$ are free groups, $\chi(F)=1-r$, $\chi(F')=1-r'$, where $r$, $r'$ are ranks of $F$ and $F'$ respectively. Thus, $f$ restricts to an epimorphism $f': F'\cong F\to F$. This epimorphism has to be injective since $F$ is Hopfian. Clearly, $Ker(f)=Ker(f')$, so injectivity of $f'$ implies injectivity of $f$. qed


I'd say that this argument is not any better than the argument which uses residual finiteness of $G$. There is also an alternative argument proving Hopfian property for $G$ which uses group actions on simplicial trees directly, without using Hopfian property for ree groups. 


