What is $\text{Hom}_{\text{cts}}(\hat{\mathbb{Z}},\mathbb{Z})$? I am trying to calculate $\text{Hom}_{\text{cts}}(\hat{\mathbb{Z}},\mathbb{Z})$ (i.e., continuous group homomorphisms from $\hat{\mathbb{Z}}$ to $\mathbb{Z}$, viewed as topological groups in the usual way). 
I know that $\hat{\mathbb{Z}} \simeq \prod_p \mathbb{Z}_p$, and I know how to write $\hat{\mathbb{Z}}$ as an inverse limit, but as far as I know $\text{Hom}(-,B)$ preserves neither of these operations in general.
 A: Note $\hat{\mathbb{Z}}$ is profinite and $\mathbb{Z}$ is discrete, so the kernel of any continuous group homomorphism $\hat{\mathbb{Z}} \to \mathbb{Z}$ is an open subgroup of $\hat{\mathbb{Z}}$, which is necessarily of finite index. If you then take the quotient by the kernel, you get a finite group injecting into $\mathbb{Z}$, which is only possible if it's the trivial group. So the map must be $0$. So $\text{Hom}_\text{cts}(\hat{\mathbb{Z}},\mathbb{Z}) = 0$.
The same proof works for any profinite group, e.g. $\mathbb{Z}_p$.
A: As already answered, it's immediate that every continuous homomorphism from a compact group to $\mathbf{Z}$ is trivial (and the same to any torsion-free discrete abelian group). 
It is also true (Alperin) that every (not supposed continuous) group homomorphism from a compact group to $\mathbf{Z}$ is trivial, but this is much less immediate, and false with $\mathbf{Z}$ replaced with $\mathbf{Q}$. However it is not hard to check in the case of $\hat{\mathbf{Z}}$, since every element is sum of a 2-divisible element and a 3-divisible element (an element of an abelian group $A$ is $p$-divisible if it is in $\bigcap_n p^nA)$.
