# When does an injective group homomorphism have an inverse?

Given two groups A and B and an injective homomorphism f: A → B. When does a homomorphism g: B → A exist with gf = idA (but not necessarily fg = idB)?

-
You may assume that $f$ is the inclusion of a subgroup $A \subseteq B$. I don't think that there is a general simple criterion. If $B$ is abelian, you have the splitting lemma which says that $A \subseteq B$ has a retract if and only if $B \to B/A$ has a section if and only if $A$ is a direct summand of $B$. – Martin Brandenburg Jun 28 '10 at 10:49
BB in his answer below mentions semidirect products, you talk about direct sums. Who of you is right (or both)? – Hans Stricker Jun 28 '10 at 10:57
I only adressed the case that $B$ is abelian. – Martin Brandenburg Jun 28 '10 at 11:05
@Martin: I see. – Hans Stricker Jun 28 '10 at 11:07

If and only if $B$ is a semidirect product of $A$ and another group (the latter is normal). One direction is obvious, and another direction is easy: $B$ is a semidirect product of the image of $f$ and the kernel of $g$.