Let $f:G\to \mathbb{Q}$ be a group homomorphism of abelian groups $G$ and $H$. Consider the short exact sequence $$0\to \ker(f)\otimes\mathbb{Q}\to G\otimes\mathbb{Q}\xrightarrow{f\otimes id} \operatorname{im}(f)\otimes\mathbb{Q}\to 0.$$ Now, the following situation is given: It is $G\otimes\mathbb{Q}\cong\mathbb{Q}$ and $\mathbb{Z}\subseteq \operatorname{im}(f)\subseteq \mathbb{Q}$.
Why follows that $f\otimes id$ is an isomorphism?
If $g\colon \mathbb{Q}\to G\otimes\mathbb{Q}$ is an isomorphism, we conclude that $$ (f\otimes\mathit{id})\circ g $$ is a nonzero homomorphism $\mathbb{Q}\to\mathbb{Q}\otimes\mathbb{Q}$.
On the other hand, $\mathbb{Q}\otimes\mathbb{Q}\cong\mathbb{Q}$ and a nonzero homomorphism $\mathbb{Q}\to\mathbb{Q}$ is an isomorphism.