Solution (source code)

= Solution

If $I=0$, take $n=1$. Otherwise, by part (b), the element $[I]$ of the finite group $\operatorname{Cl}(K)$ has finite order, say $n\geq1$. Therefore
$$
[I^n]=[I]^n=1,
$$
which says precisely that $I^n$ is principal. Since $I^n$ is integral, if $I^n=(\alpha)$ then necessarily $\alpha\in\mathcal O_K$.