Solution (source code)

= Solution

By the <Fundamental theorem of finitely generated abelian groups>,
$$
A\cong\mathbb Z^r\oplus T
$$
with $T$ finite. If a nonzero element has a nonzero component in $T$, projection to $T$ separates it. Otherwise some integer coordinate is a nonzero $n$; choose a prime $p$ not dividing $n$ and reduce that coordinate modulo $p$. This gives a finite quotient in which the element survives, so every finitely generated abelian group is residually finite.