Let $K$ be a algebraic number field of degree $n$ over $\mathbb{Q}$, and $O$ its ring of integers. Let $P$ be a prime ideal of $O$ and $(p)=P \cap \mathbb{Z}$.
Is it true that the localization $O\_{P}$ is a rank $n$ free module over $\mathbb{Z}\_{(p)}$ (the localization of $\mathbb{Z}$ at $(p)$) if and only if $P$ is the only prime above $(p)$?



Localizations as free, finite rank modules
Well, if $P$ is not the only prime above $p$, then $O\_P$ cannot be a finitely-generated $\mathbb{Z}\_{(p)}$-module for the following reason. Suppose $Q$ is another prime ideal above $p$ and select $\beta\in Q\setminus P$. Then $\beta^{-1}\in O\_P$. If $O\_P$ were finitely-generated as a module over $\mathbb{Z}\_{(p)}$, then it would be integral over $\mathbb{Z}\_{(p)}$, and hence would be contained in the integral closure of $\mathbb{Z}\_{(p)}$ in $K$, which is $O\_p$. But then $\beta^{-1}\in O\_p$, so $1/\beta=\alpha/m$ for some integer $m$ not divisible by $p$. This means that $m=\alpha\beta\in Q$, whence $m\in Q\cap\mathbb{Z}=(p)$, a contradiction. 


