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 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 by Lyndon & Schupp)?