TITLE: If subgroups are preserved under preimages, is it necessarily a homomorphism?
QUESTION [9 upvotes]: Consider a function $f : G \rightarrow H$, where $G$ and $H$ are groups, such that preimage of every subgroup of $H$ is a subgroup of $G$. Is it possible that $f$ could fail to be a homomorphism? Is it possible that $f$ could be surjective, yet fail to be a homomorphism?

REPLY [14 votes]: Take a cyclic group of order $p$ with prime $p>3$, and let $f$ fix the identity and permute the non-identity elements. Not all such maps are homomorphisms. There are only two subgroups, so the inverse image condition is satisfied.