Let us look at the short exact sequence
$0\rightarrow \ker f\stackrel{i}\rightarrow G\stackrel{f}\rightarrow \Bbb Z\rightarrow 0$
with $\,i\,$ injection.
Let us use the universal property of the free abelian group $\,\Bbb Z=\langle\,1\,\rangle\,$ : choose $\,x\in G\setminus\ker f\,$ and put $\,\overline g(1):=x\,$ , then there exists a unique homomorphism $\,g:\Bbb Z\to G\,$ s.t. $\,g(1)=\overline g(1)=x\,$.
Since $\,\overline 0\neq x+\ker f\in G/\ker f\cong\Bbb Z\,$ , clearly $\,x\,$ has infinite order and thus
$H:=g(\Bbb Z)=\langle\,x\,\rangle\,\cong\Bbb Z$
Now : $y\in H\cap \ker f\Longrightarrow y=mx\wedge f(y)=0\;\;,\;m\in\Bbb Z\Longrightarrow$
$ 0=f(mx)=mf(x)\Longrightarrow m=0\vee x\in \ker f$
Since $\,x\notin\ker f\,$ by choice, it must be $\,m=0\Longrightarrow y=0\,$
Can you take it from here now and end the argument?