TITLE: Homomorphism from $\hat{\mathbb{Z}}$ to $\mathbb{Z}$
QUESTION [18 upvotes]: I expect this question has a very simple answer.
We all know from primary school that there are no non-trivial continuous homomorphisms from $\hat{\mathbb{Z}}$ to $\mathbb{Z}$.  What if we forget continuity: can anybody give an explicit example of a homomorphism?
Note that $\hat{\mathbb{Z}}$ is torsion-free, and not divisible (since it's isomorphic to $\prod_p \mathbb{Z}_p$ and $\mathbb{Z}_p$ is not divisible by $p$).  There is the canonical injection $\mathbb{Z} \to \hat{\mathbb{Z}}$; is there some abstract reason why it ought to have a left inverse, and if so can we write it down?

REPLY [46 votes]: Let $\phi:\hat{\mathbb{Z}}\to\mathbb{Z}$ be a nontrivial homomorphism.  As every nontrivial subgroup of $\mathbb{Z}$ is isomorphic to $\mathbb{Z}$, we may suppose that $\phi$ is surjective, with kernel $K$ say.  Now $\phi$ induces a surjective homomorphism $\phi_n:\hat{\mathbb{Z}}/n\hat{\mathbb{Z}}\to\mathbb{Z}/n\mathbb{Z}$, but it is standard that $\hat{\mathbb{Z}}/n\hat{\mathbb{Z}}$ has order $n$, so $\phi_n$ must be an isomorphism.  This implies that $K\leq n\hat{\mathbb{Z}}$ for all $n$, but $\bigcap_n n\hat{\mathbb{Z}}=0$, so $\phi$ is injective, which is clearly impossible.

REPLY [4 votes]: Let $\phi$ be such a homomorphism, on additive groups $\hat Z\rightarrow Z$. Write $(\vec x,\vec y)\in\hat Z$ for the element that is $x$ on primes that are 1 mod 3, and $y$ on primes that are 2 mod 3. 
Then $\phi(\vec x,\vec 0)=0$ for all $x\in Z$, for $(\vec x,\vec 0)$ is $l$-divisible for any prime $l$ that is 2 mod 3. The symmetrical argument claims $\phi(\vec 0,\vec y)=0$ too.
Without loss of generality, we can assume that a preimage of $1$ is given by $(\vec 1,\vec 1)$.
Next, applying the group law and setting $\alpha=\phi(\vec 1,\vec{-1})$, we derive the system $$1+\alpha=\phi(\vec 1,\vec 1)+\phi(\vec 1,\vec{-1})=\phi(\vec 2,\vec 0)=0$$
$$1-\alpha=\phi(\vec 1,\vec 1)-\phi(\vec 1,\vec{-1})=\phi(\vec 0,\vec 2)=0$$
This is impossible, so $\phi$ does not exist.