
  Is it true that, in the category of $\mathbb{Z}$-modules, $\operatorname{Hom}_{\mathbb{Z}}(\mathbb{Z}[x],\mathbb{Z})\cong\mathbb{Z}[[x]]$ and $\operatorname{Hom}_{\mathbb{Z}}(\mathbb{Z}[[x]],\mathbb{Z})\cong\mathbb{Z}[x]$?


The first isomorphism is easy since any such homomorphism assigns an integer to $x^i, \forall\ {i>0}$ which defines a power series. For the second one might think similarly that if $S$ is the set of all power series with non-zero constant term then $\mathbb{Z}[[x]]=0\oplus{S}\oplus{x}S\oplus{x^2}S\dots$,  but it doesn't quite work since it is not clear how to map $S$. 

Yes: this is an old chestnut. Let me write $\oplus_n\mathbf{Z}$ for what you call $\mathbf{Z}[x]$ and $\prod_n\mathbf{Z}$ for what you call $\mathbf{Z}[[x]]$ (all products and sums being over the set {$0,1,2,\ldots$}). Clearly the homs from the product to $\mathbf{Z}$ contain the sum; the issue is checking that equality holds. So say I have $f:\prod_n\mathbf{Z}\to\mathbf{Z}$ and let me prove $f$ is in the sum.

Let $e_n$ ($n\geq0$) be the $n$th basis element in the product (so, what you called $x^n$).
First I claim that $f(e_n)=0$ for all $n$ sufficiently large. Let's prove this by contradiction. If it were false then I would have infinitely many $n$ with $f(e_n)\not=0$, so by throwing away the $e_n$ such that $f(e_n)=0$ (this is just for simplicity of notation; otherwise I would have to let this infinite set of $n$ be called $n_0$, $n_1\ldots$ and introduce another subscript) we may as well assume that $f(e_n)=c_n\not=0$ for all $n=0,1,2,\ldots$. Now choose any old integers $d_i$ such that $\tau:=\sum_{i\geq0}2^id_ic_i$, a 2-adic integer, is not in $\mathbf{Z}$ (this can easily be done: infinitely many $d_i$ are "the last to change a binary digit of $\tau$" and hence one can recursively rule out all elements of $\mathbf{Z}$), and consider the integer $t:=f(\sum_{i\geq0}2^id_ie_i)\in\mathbf{Z}$. The point is that $\sum_{i\geq N}2^id_ie_i$ is a multiple of $2^N$ in the product, and hence its image under $f$ must be a multiple of $2^N$ in $\mathbf{Z}$. So one checks easily that $t-\tau$ is congruent to zero mod $2^N$ for all $N\geq1$ and hence $t=\tau$, a contradiction.

[Remark: in my first "answer" to this question, I stopped here. Thanks to Qiaochu for pointing out that my answer wasn't yet complete.]

We deduce that $f$ agrees with an element $P$ of the sum on the subgroup $\oplus_n\mathbf{Z}$ of $\prod_n\mathbf{Z}$. So now let's consider $f-P$; this is a map from the product to $\mathbf{Z}$ which is zero on the sum, and our job is to show that it is zero. So far I have used the fact that $\mathbf{Z}$ has one prime but now I need to use the fact that it has two. Firstly, any map $(\prod_n\mathbf{Z})/(\oplus_n\mathbf{Z})\to\mathbf{Z}$ is clearly going to vanish on the infinitely $p$-divisible elements of the left hand size for any prime $p$ (because there are no infinitely $p$-divisible elements of $\mathbf{Z}$ other than $0$). In particular it will vanish on elements of $\prod_n\mathbf{Z}$ of the form $(c_0,c_1,c_2,\ldots,c_n,\ldots)$ with the property that $c_n$ tends to zero $p$-adically. Call such a sequence a "$p$-adically convergent sequence". But using the Chinese Remainder Theorem it is trivial to check that every element of $\prod_n\mathbf{Z}$ is the difference of a 2-adically convergent sequence and a 3-adically convergent sequence, and so now we are done.

Remark: I might be making a meal of this. My memory of what Kaplansky writes is that he uses the second half of my argument but does something a bit simpler for the first half.
