Let us say that a group $H$ is almost projective if, given any group epimorphism $f\colon G\to H$, there is an embedding $i\colon H\to G$.
Does it follow that $H$ is free? If not, is there a characterisation of such groups? Does the answer change if we restrict ourselves to the category of finitely generated groups?
Note that I do not require that $f\circ i$ be identity, so this may be strictly weaker than being truly projective. For example, all finite cyclic groups are almost projective in the category of torsion groups, even though they are not projective (unless they are trivial), and I think all finite abelian groups are almost projective in the category of torsion abelian groups.