TITLE: Why are $p$-adic numbers and $p$-adic integers only defined for $p$ prime?
QUESTION [21 upvotes]: It makes perfect sense to speak of a base $10$ digit expansion. Why does it not make sense to speak of $10$-adic numbers or $10$-adic integers?

REPLY [14 votes]: I was going on at too great length in a comment to a discussion between Henning Makholm and Hurkyl, so let me put it all into an answer instead:
To show that $\Bbb Z_{10}\cong\Bbb Z_2\times\Bbb Z_5$, you need to find a pair of orthogonal idempotents, call them $E_2$ and $E_5$ such that $E_p^2=E_p$ for $p=2$ and $5$, $E_2E_5=0$, and $E_2+E_5=1$.
To do this, you find consistent sequences $\{e_{2,n}\}$, $\{e_{5,n}\}$ such that
\begin{align}
e_{p,n}^2&\equiv e_{p,n}\pmod{10^n}\\
e_{2,n}e_{5,n}&\equiv0\pmod{10^n}\\
e_{2,n}+e_{5,n}&\equiv1\pmod{10^n}\,.
\end{align}
And here’s how to do that: Use Chinese Remainder Theorem to get
\begin{align}
e_{2,n}&\equiv1\pmod{2^n},&e_{2,n}\equiv0\pmod{5^n}\\
e_{5,n}&\equiv0\pmod{2^n},&e_{5,n}\equiv1\pmod{5^n}.
\end{align}
And that would be the whole story, except that it’s easier to compute $E_2$ and $E_5$ than to describe the process. Start with the right numbers modulo $10$, namely $e_{2,1}=5$ and $e_{5,1}=6$. Raise the first of these successively to $2$-power powers, the second successively to $5$-power powers, and look at the last digits. But it’s even easier than that, ’cause you only need to start with $2$-powers of $5$ for your $e_{2,n}$’s, and subtract from $1$ for the other approximant. 
So you start $5$, $25$, $625$, $390625\equiv0625$, etc., and easily get to ten digits with $8212890625\equiv E_2\pmod{10^{10}}$, and from that
$E_5\equiv1787109376\pmod{10^{10}}$. I’ll leave it to the interested reader to do the three multiplications that show that these are indeed orthogonal idempotents modulo $10^{10}$.
EDIT — Addendum
user1952009 and Henning Makholm have asked what good all of the above is. It’s just that if you have a $2$-adic integer $S_2$ and a $5$-adic integer $S_5$, then you get a $10$-adic integer corresponding to $(S_2,S_5)$ this way: approximate $S_2$ by ordinary integers $\{s_{2,n}\}$ and $S_5$ by $\{s_{5,n}\}$, then at each stage, multiply the $2$-adic approximants by $E_2$ and the $5$-adic approximants by $E_5$. You get two $10$-adic integers, and you add them to get your $(S_2,S_5)$.
For instance, suppose you want something in $\Bbb Z_{10}$ that’s the $2$-adic integer $\sqrt{-7}$ and the $5$-adic integer $23/128$. To ten places, these are $b5;$ in hex notation for the $2$-adic integer and $4201334331;$ in $5$-ary notation for the element of $\Bbb Z_5$. As integers modulo $10^{10}$, these are $181$ and $8621216$, respectively.
Now, $181$ is congruent to $\sqrt{-7}$ modulo $2^{10}$, but it’s something unwanted modulo $5^{10}$, so we multiply it by $8212890625$, which is $1$ modulo $2^{10}$ and zero modulo $5^{10}$. Result is good at $2$ and zero at $5$. Do the same thing for $8621216$, which is $\equiv23/128\pmod{5^{10}}$, but something useless modulo $2^{10}$, But $8621216\cdot1787109376$ is good at $5$ and zero at $2$. Add these two products modulo $10$, get
$$181\cdot8212890625+8621216\cdot1787109376\equiv2479324341\pmod{10^{10}}\,.$$
This is a number whose square $\equiv-7\pmod{2^{10}}$, and such that when you multiply it by $128$, the result is $\equiv23\pmod{5^{10}}$, which is what I promised.
FURTHER EDIT — in response to Henning Makholm’s very valid objections.
I apologize for the logical messiness of all this. It would have been better to toss out all my previous posting and replace with what’s below, but that would have invalidated all the comments.

A sequence is $10$-adically convergent (resp. Cauchy) if and only if it is both $2$-adically and $5$-adically convergent (resp. Cauchy).  
The idempotent $E_2$ is made from the sequence $\{5^{2^n}\}$ that is $2$-adically convergent to $1$ and $5$-adically convergent to $0$. The orthogonal idempotent $E_5=1-E_2$ is similarly made from a sequence $2$-adically convergent to $0$ and $5$-adically convergent to $1$.  
$\Bbb Z_2\cong\Bbb Z_{10}E_2$, because for every $\alpha\in\Bbb Z/2^n\Bbb Z$, there is $\alpha'\in\Bbb Z/{10}^n\Bbb Z$ such that $\alpha\equiv\alpha'\pmod{2^n}$ and $\alpha'\equiv0\pmod{5^n}$, namely $\alpha'=5^{2^n}\alpha$. Similarly, $\Bbb Z_5\cong\Bbb Z_{10}E_5$, because for every $\beta\in\Bbb Z/5^n\Bbb Z$, there is $\beta'\in\Bbb Z/10^n\Bbb Z$ with $\beta'\equiv\beta\pmod{5^n}$ and $\beta'\equiv0\pmod{2^n}$.  
There is a surjective ring homomorphism $\Bbb Z_{10}\to\Bbb Z_2$, by $w\mapsto wE_2$, similarly for $w\mapsto wE_5$ giving a surjective homomorphism to $\Bbb Z_5$.
This should be enough to show that $\Bbb Z_{10}\cong\Bbb Z_2\oplus\Bbb Z_5$. But Henning asks why there is no other such decomposition. The answer has to do with the fact that the only idempotents in $\Bbb Z_p$ are $0$ and $1$.  
Let $e$ be any idempotent in $\Bbb Z_{10}$. I say that $e$ is either $0$, $E_2$, $E_5$, or $1$. Indeed, $e=e\cdot1=e(E_2+E_5)=eE_2+eE_5$. But $eE_2$ is an idempotent in $\Bbb Z_{10}E_2\cong\Bbb Z_2$, so $0$ or the unity there, namely $E_2$. Similarly $eE_5$ is either $0$ or $E_5$, and these four cases exhaust the four claimed possibilities for idempotents in $\Bbb Z_{10}$.