Does there exist a non-trivial group $G$ without automorphisms, a homomorphism $f:H\to G$ and a homomorphism $g:G\to H$ such that $g\circ f = \mathrm{id}_H$ for some group $H$ with non-trivial automorphisms.
The answer is no:
We have $G\cong C_2$, and $f$ is injective. There are no subgroups of $C_2$ with non-trivial automorphisms.