I have a silly doubt: if $f: G \longrightarrow G'$ is a function between groups sending subgroups $G$ in subgroups of $G'$, it is true that $f$ is a homomorphism between $G$ and $G'$? I'm convicted that this is false, but I have no clue on how to construct a counterexample. Can you help me, please?