The object here is to prove that the ring of integers in the $n$-th cyclotomic number field $\Q(\zeta_n)$ is its subring $\Z[\zeta_n]$. Here $\zeta_n$ denotes a primitive $n$-th root of unity in $\C$, e.g. $$ \zeta_n=e^{\frac{2i\pi}{n}}. $$ Since $\zeta_n$ is a root of the polynomial $X^n-1$, which has integral coefficients, $\zeta_n$ is integral over $\Z$. This shows that $\Z[\zeta_n]$ is contained in the ring of integers of $\Q(\zeta_n)$. What we need to prove is that any algebraic integer in $\Q(\zeta_n)$ belongs to $\Z[\zeta_n]$. The strategy is to prove it first for $n$ a prime power, and then deduce the general case from this. We need some preliminary statements.

Let $n$ be any natural integer and let, in order to simplify notation, $\zeta$ be a primitive $n$-th root of unity. Let $i$ and $j$ be integers relatively prime to $n$. Then $$ \frac{1-\zeta^i}{1-\zeta^j} $$ is a unit of $\Z[\zeta]$. Indeed, since $j$ is relatively prime with $n$, there is an integer $k$ such that $jk\equiv i\pmod n$ by Bezout's Theorem. Since $\zeta^n=1$, one has $$ \frac{1-\zeta^i}{1-\zeta^j}= \frac{1-(\zeta^j)^k}{1-\zeta^j}= 1+\zeta^j+(\zeta^{j})^2+\cdots+(\zeta^j)^{k-1}. $$ This shows that the fraction in question belongs to $\Z[\zeta]$. By symmetry, its inverse also belongs to $\Z[\zeta]$. This proves that the fraction in question indeed is a unit of $\Z[\zeta]$.

Let $p$ be a prime number and let $e$ be any nonzero natural number. Let $\zeta$ be a primitive $p^e$-th root of unity. Then, the prime ideal $p\Z$ is completely ramified in $\Z[\zeta]$, i.e., one has $$ (p)=(1-\zeta)^d $$ as ideals in $\Z[\zeta]$, where $d$ is the degree of the extension $\Q(\zeta)/\Q$. Indeed, recall that the minimal polynomial of $\zeta$ over $\Q$ is the $p^e$-th cyclotomic polynomial $\Phi$ which decomposes over $\Q(\zeta)$ as $$ \Phi=\prod_{\substack{i=0\\(i,p^e)=1}}^{p^e-1}(X-\zeta^i). $$ Note that the product of the "missing" factors, i.e. those for which $(i,p^e)\neq1$, is equal to $X^{p^{e-1}}-1$. Hence, $$ (X^{p^{e-1}}-1)\cdot\Phi=X^{p^e}-1, $$ from which we deduce that $$ \Phi= \frac{X^{p^e}-1}{X^{p^{e-1}}-1}= \frac{(X^{p^{e-1}})^p-1}{X^{p^{e-1}}-1}= X^{p^{e-1}(p-1)}+X^{p^{e-1}(p-2)}+\cdots+1. $$ Since the latter polynomial has exactly $p$ terms whose coefficients are all equal to $1$, one has $$\begin{equation}\label{eqnphi1} p=\Phi(1)=\prod_{\substack{i=0\\(i,p^e)=1}}^{p^e-1}(1-\zeta^i)= (1-\zeta)^{d}\cdot\prod_{\substack{i=0\\(i,p^e)=1}}^{p^e-1}\frac{1-\zeta^i}{1-\zeta} \end{equation}$$ in $\Z[\zeta]$. By what we have seen above, the last huge factor is a unit in $\Z[\zeta]$, being a product of units. The statement about the ideal $(p)$ follows.

Note that the ideal $(1-\zeta)$ in $\Z[\zeta]$ is a prime ideal since the quotient $$ \Z[\zeta]/(1-\zeta)= \Z[\zeta]/(1-\zeta,p)= \Z[X]/(\Phi,1-X,p)=\Z/(\Phi(1),p)= \F_p $$ is an integral domain. Also, $(1-\zeta)$ is the only prime ideal of $\Z[\zeta]$ containing $p$ since the quotient $$ \Z[\zeta]/(p)=\Z[X]/(\Phi,p)=\F_p[X]/(\overline\Phi)=\F_p[X]/(X-1)^d $$ contains only one prime ideal, where $\overline\Phi$ is the reduction of $\Phi$ modulo $p$.

It will be useful to note that equation $(\ref{eqnphi1})$ also shows that the norm $N(1-\zeta)$ of $1-\zeta$ is equal to $p$. Since $\zeta^i$ is a conjugate of $\zeta$ over $\Q$ whenever $i$ is not a multiple of $p$, the norm $N(1-\zeta^i)$ also is equal to $p$.

Recall that the discriminant $\Delta$ of $\Z[\zeta]$ over $\zeta$ is $$ \Delta=(-1)^{\frac{d}{2}}\cdot p^{de-p^{e-1}}, $$ where $\zeta$ is a primitive $p^e$-th root of unity, and $d$ is the degree of $\Q(\zeta)/\Q$. Here we have assumed that $p^e\neq 2^1$, i.e., that $\Z[\zeta]\neq\Z$.

We are now ready to show that $\Z[\zeta]$ is the ring of integers in $\Q(\zeta)$ in case $\zeta$ is a primitive $p^e$-th root of unity. Indeed, denote by $\SO$ the ring of integers in $\Z[\zeta]$. As we have seen above, $\Z[\zeta]$ is a subring of $\SO$. We need to show that $\Z[\zeta]=\SO$. Note that both $\Z[\zeta]$ and $\SO$ are free $\Z$-modules of rank $d$. Therefore, $\Z[\zeta]$ is a subgroup of $\SO$ of finite index. We show that this index is equal to $1$.

Let $P$ be any prime ideal of $\SO$ containing $p$. Since $(1-\zeta)$ is the only prime ideal of $\Z[\zeta]$ containing $p$, one has $$ P\inter \Z[\zeta]=(1-\zeta), $$ and $$ P^d\inter\Z[\zeta]\supseteq(1-\zeta)^d \ni p. $$ It follows that the ramification index of $P$ over $\Z$ is at least $d$, the degree of the extension $\Q(\zeta)/\Q$. Hence, the ramification index of $P$ is equal to $d$, and the degree of the prime ideal $P$ is equal to $1$. In particular, the injective morphism $$ \F_p=\Z[\zeta]/(1-\zeta)\ra \SO/P $$ is an isomorphism. More generally, the morphism $$ f_i\colon \Z[\zeta]/(1-\zeta)^i\ra \SO/P^i $$ is an isomorphism for all natural integers $i=1,\ldots,d$. Indeed, its restriction $$ g_i\colon (1-\zeta)^{i-1}/(1-\zeta)^i\ra P^{i-1}/P^i $$ is an $\F_p$-linear morphism between $\F_p$-vector spaces of dimension $1$. Moreover, it is nonzero since it maps the class of $(1-\zeta)^{i-1}$ to the class of $(1-\zeta)^{i-1}$ in $P^{i-1}/P^i$. The latter class is nonzero, otherwise one would have $$ (1-\zeta)^{d-1}=(1-\zeta)^{i-1}\cdot(1-\zeta)^{d-i}\in P^i\cdot P^{d-i}=P^d=p\SO $$ which is absurd since it would imply that $p^{d-1}$ is a multiple of $p^d$ in $\Z$, after taking norms. It follows that $g_i$ is an $\F_p$-linear isomorphism. By induction, $f_i$ is an isomorphism. In particular, $f_d$ is an isomorphism. This means in particular that $$ p\SO+\Z[\zeta]=\SO, $$ or $$ p(\SO/\Z[\zeta])=\SO/\Z[\zeta]. $$ Hence the index of $\Z[\zeta]$ in $\SO$ is prime to $p$.

Since the absolute value $|\Delta|$ of the discriminant of $\Z[\zeta]$ is a power of $p$, the index of $\Z[\zeta]$ in $\SO$ is a power of $p$ itself. It follows that the index of $\Z[\zeta]$ in $\SO$ is equal to $1$, i.e., $\Z[\zeta]=\SO$, if $\zeta$ is a primitive $p^e$-th root of unity, as was to be proven.

As a consequence, the discriminant of $\SO$ over $\Z$, or, what amounts to the same, the discriminant of $\Q(\zeta)$ over $\Q$ is $$ \Delta_{\Q(\zeta)/\Q}=(-1)^{\frac{d}{2}}\cdot p^{de-p^{e-1}}, $$ where $\zeta$ is a primitive $p^e$-th root of unity, and $d$ is the degree of $\Q(\zeta)/\Q$. It follows that $p$ ramifies in $\Q(\zeta)$, and that no other prime is ramified in $\Q(\zeta)$.

In order to deduce the general case from the prime power case, we will use the following result for which we refer to Lang, Proposition III.17. Let $K$ and $L$ be linearly disjoint number fields, i.e. $K\inter L=\Q$. Let $\SO$ and $\SP$ be the rings of integers in $K$ and $L$, respectively. If the discriminants of $K$ and $L$ over $\Z$ are relatively prime, then the ring of integers of the compositum $KL$ is $\SO\SP$.

Now we turn to the general case where $n$ is any nonzero natural number, and we prove that the ring of integers in $\Q(\zeta)$ is equal to $\Z[\zeta]$, where $\zeta$ is a primitive $n$-th root of unity. Let $$ n=p_1^{e_1}\cdots p_r^{e_r} $$ be the prime factorization of $n$. Let $\zeta_i$ be a primitive $p_i^{e_i}$-th root of unity, and let $\eta_i=\zeta_1\cdots\zeta_i$ for $i=0,\ldots,r$. Let $$ n_i=p_1^{e_1}\cdots p_i^{e_i} $$ for $i=0,\ldots,r$. Then $\eta_i$ is a primitive $n_i$-th root of unity. Suppose by induction that the ring of integers in $\Q(\eta_i)$ is the subring $\Z[\eta_i]$, for some $i

As a consequence, the discriminant of $\Q(\zeta)$ over $\Q$ is equal to the discriminant of $\Z[zeta]$ over $\Z$. In particular, the number field $\Q(\zeta)$ is ramified over all primes dividing $n$, and unramified over the primes that do not divide $n$. Here it is assumed that $n\not\equiv2\pmod4$, as one can always do when considering the numberfield $\Q(\zeta)$.