Bijective hom sets

Let $f: G \to H$ be a group homomorphism. Suppose that the induced map $F: \text{Hom}(H,H) \to \text{Hom}(G,H)$ defined by $F(\phi) \stackrel{\text{def}}{=} \phi \circ f$ is a bijection. Show that if $G$ is abelian, then so is $H$.

I'm wondering if there is a fancy categorical proof of this theorem.

-
The proof I know you show f(G) is contained in Z(H), so that all inner automorphisms in H agree with the identity on f(G). Hence they are all the identity and H is abelian. But it looks like something nicer should exist. – Joe Aug 15 '11 at 1:02
What I'm hoping (and I have no reason to) is that Yoneda lemma somehow applies, because I'd like a better understanding of it. – Joe Aug 15 '11 at 1:03
It's quite easy to show that the condition on the hom-set map implies $f$ is an epimorphism. But at the moment I'm not seeing a good abstract-nonsense proof that epimorphisms transport abelian group structure... – Zhen Lin Aug 15 '11 at 2:03
An epimorphism in the category of groups is necessarily surjective... – Keenan Kidwell Aug 15 '11 at 3:19
@Zhen: there are tons of surjective functions from a group $G$ to a set $X$ which are not homomorphisms for any group structure on $X$... – Mariano Suárez-Alvarez Oct 23 '11 at 23:03

1 Answer

I'm actually going to answer a slightly different question, which is the one I think I really wanted to ask: is this question motivated by category theory? I first saw this question on an old qualifying exam, and it seemed like there was more to it. In fact, I was told last week that it's related to the idea of localization. A good source of information on this concept can be found here (it wouldn't let me direct link to the pdf, but it's the paper number 101 called localizations on that page). The qualifying exam question can now be phrased: abelian groups are closed under localization. The same question has been posed for other classes of groups. For example, finite groups, perfect groups and torsion abelian groups are all not closed under localization. Nilpotent groups of class 2 are closed under localization.

-