Prove that no nontrivial unitary $\mathbb{Z}$-module(or equivalently, abelian group) is both projective and injective.
My attempt: Since $\mathbb{Z}$ is a PID, injective modules are the same as divisible modules. Therefore, it suffices to show that a divisible module is never projective. Let $D$ be any divisible $\mathbb{Z}$-module. Then we have to find two abelian groups $M$ and $N$ such that for some homomorphism $\phi:M\to N$, a homomorphism $f:D\to N$ does not lift to a homomorphism $\bar{f}:D\to M$. Here is where I'm stuck. How should I proceed further? I tried to find a counterexample, but I failed. Does anyone have ideas?
Suppose a divisible module $D$ is projective. Then $D$ embeds in a direct sum of copies of $\mathbb{Z}$. Does such a module have nonzero divisible submodules?
Hint: if $A$ and $B$ are reduced $\mathbb{Z}$-modules (that is, they have no nonzero divisible submodule), then $A\oplus B$ is reduced as well. Generalize to arbitrary direct sums.
Actually you don't need to use the fact that injective modules are the same as the divisible modules: every injective module over a domain is divisibile (the converse might not hold).
You also don't need to know that a projective $\mathbb{Z}$-module is free.