Suppose that $G$ is a group and $f$ a group endomomorphism of $G$. Let $H = \{g \in G \mid f^n(g) = f^m(g) \textrm{ for some positive integers } n,m \textrm{ with } n \neq m\}$ be the set of preperiodic points of $f$. Is $H$ a subgroup of $G$?
I know that if $f$ is injective or if $G$ is finite then this is true because in this case $H$ is the same as the set of periodic points $\{g \in G \mid f^n(g) = g \textrm{ for some positive integer } n\}$. But I can't seem to figure out whether it is true for other cases. I'd appreciate some help on this!