Let $f : G \to G$ be a homomorphism from a finitely generated abelian group $G$ to itself. If we write $G = B \oplus T$, with $B$ free abelian and $T$ the torsion subgroup, assume that $f(T) \subseteq T$ and $f$ is injective. Is it true that $f$ is an isomorphism?
My thoughts: Since $T$ is a finite group, $f \vert_T : T \to T$ is an isomorphism. Moreover, since $\ker f = 0$, we have
$$ \operatorname{rank}(G) = \operatorname{rank}(\operatorname{im}f). $$
Does it follow that $f$ is surjective?
Edit: as suggested in the comments, this is false. Just take $G = \mathbb{Z}$ and $f(n) = 2n$.
What if we assume that the image of $f$ is a direct summand? Suppose $G = \operatorname{im}f \oplus S$, for some subgroup $S \subset G$. Then, since
$$\operatorname{rank}(G) = \operatorname{rank}(\operatorname{im}f) + \operatorname{rank}(S),$$
the equation above implies that $\operatorname{rank}(S) =0$, so $S \subseteq T$. Does this imply that $\operatorname{im} f \supseteq B$?
Yes. The quickest way to see it is probably to take the tensor product with $\mathbb Q$ to promote $f|_B$ to a linear transformation of vector spaces and then use linear algebra to show that if the ranks are equal, then it sends a basis to a basis. This also applies for $n \mapsto 2n$ (the problem being that $2$ is invertible in $\mathbb Q$ but not $\mathbb Z$), but your additional assumption that the image is a direct summand suffices to rule this out.