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?