Since this question popped up again, I might as well sketch how far I got. The trivial morphism can be recognized because it factor through the trivial group, so the trivial morphism must be sent to itself. From this we deduce that the obvious inclusions and projections between $G$, $H$ and $G \times H$ are sent to themselves up to the sort of evil isomorphisms discussed in Reid's answer. For any group $F$ with maps $F \to G$ and $F \to H$, the product map $F \to G \times H$ is sent to the product map, again, up to evil isomorphisms. In particular, the diagonal embedding $G \to G \times G$ is sent to the diagonal up to isomorphisms.

If $G$ is abelian, then $\mu: (g_1, g_2) \mapsto g_1 g_2$ is a map $G \times G \to G$ and analyzing the composition of $\mu$ with the coordinate embeddings $G \to G \times G$ shows that $\mu$ goes to $\mu$ (up to isomorphism). Composing diagonals and $\mu$, one deduces that $g \mapsto g^n$ goes to itself (up to isomorphism) for any abelian $G$ and integer $n$. Using the classification of finitely generated abelian groups, one deduces that all maps of finite generated abelian groups go to themselves (up to isomorphism).

I believe I was able to argue that the mystery functor must commute with the abelianization function up to natural isomorphism, but I don't have notes from this anymore. My plan for getting beyond this was to chase the isomorphism down the derived series, argue is particular everything must be good for maps of free groups as the intersection of the derived subgroups is trivial there, and then somehow use that everything is a quotient of a free group to win. But I got stuck around this point.

This question has a very similar feel to this math.SE question: Is there a function $\mathcal{P}$ from connected topological spaces to groups such that $\mathcal{P}(X) \cong \pi_1(X)$? One can show that such a functor can't restrict to $\pi_1$ on pointed spaces, which is probably what the OP meant to ask, but it seems hard to rule out that there is some functor.