I was reading a proof to this proposition from this link:
http://planetmath.org/abeliangroupisdivisibleifandonlyifitisaninjectiveobject
they proceed by contradiction, so $A$ is not divisible and there exists $a \in A$ and $n \in \mathbb{N}$ such that the equation $nx=a$ does not have solution in $A$. Then they defined $B = <a>$ and they considered two cases, when $B$ is infinite and when $B$ is finite but I don't understand the case when the order of the group $B$ is finite. In particular I don't know how to prove that $n$ does not divide $k$ and how to use it to define the homomorphism $f$ such that $f(a)=n$.
The assertion that $n$ does not divide $k$ is incorrect, and is not used anywhere in the rest of the argument.
The homomorphism $f$ is defined by $f(ma)=mn$ for each integer $m$. This is well-defined since $ma=m'a$ iff $m-m'$ is divisible by $k$ (since $a$ has order $k$), but then $mn=m'n$ in $\mathbb{Z}_{nk}$ since $mn-m'n=(m-m')n$ is divisible by $nk$.