Solution to Abstract Algebra by Dummit & Foote 3rd edition Chapter 7.1 Exercise 7.1.23
Let $D$ be a squarefree integer, and let $O$ be the ring of integers in the quadratic field $\mathbb{Q}(\sqrt{D})$. (I.e. $O = \mathbb{Z}[\omega]$.) For any positive integer $f$ prove that the set $$O_f = \mathbb{Z}[f\omega] = \{ a + bf\omega \ |\ a,b \in \mathbb{Z} \}$$ is a subring of $O$ containing the identity. Prove that $[O : O_f] = f$. (The index as an abelian group.) Prove conversely that a subring of $O$ containing the identity and having (as a subgroup) finite index $f$ is equal to $O_f$. (The ring $O_f$ is called the order of conductor $f$ in the field $\mathbb{Q}(\sqrt{D}$). The ring of integers $O$ is called the maximal order in $\mathbb{Q}(\sqrt{D})$.)
Solution: First we show that $O$ is a subgroup of $\mathbb{Z}[\omega]$. To see this, note that $0 + 0f\omega \in O$. Now let $x = a_1 + a_2 f \omega$ and $y = b_1 + b_2 f \omega$ be in $O$. Then $$x-y = (a_1 – b_1) + (a_2 – b_2)f \omega \in O,$$ so that by the subgroup criterion, $O$ is an additive subgroup of $\mathbb{Z}[\omega]$.
Now it is easy to see that $\omega^2 = D$ or $\omega + (D-1)/4$, depending on whether $D$ is not or is 1 mod 4. Moreover, if $D$ is 1 mod 4, then $(D-1)/4$ is an integer. Thus we have $$xy = (a_1b_1 + a_2b_2f^2D) + (a_1b_2 + a_2b_1)f \omega$$ or $$(a_1b_1 + a_2b_2f^2(D-1)/4) + (a_1b_2 + a_2b_1 + a_2b_2)f \omega,$$ depending on whether $D$ is not or is 1 mod 4. In either case, $xy \in \mathbb{Z}[f \omega]$. Thus $\mathbb{Z}[f \omega] \subseteq \mathbb{Z}[\omega]$ is a subring.
Now we will show that $[\mathbb{Z}[\omega] : \mathbb{Z}[f \omega]] = f$. Define a mapping $\Phi : \mathbb{Z}[\omega] \rightarrow \mathbb{Z}$ by $\Phi(a + b\omega) = b$. We claim that $\Phi$ is an additive group homomorphism. To see this, note that \begin{align*}\Phi((a_1 + a_2 \omega)+(b_1 + b_2\omega)) =&\ \Phi((a_1 + b_1) + (a_2 + b_2)\omega)\\ =&\ a_2 + b_2 = \Phi(a_1 + a_2 \omega) + \Phi(b_1 + b_2 \omega).\end{align*} Moreover, $\Phi$ is surjective since for all $n \in \mathbb{Z}$, $\Phi(0 + n \omega) = n$. Consider now $\pi \circ \Phi : \mathbb{Z}[\omega] \rightarrow \mathbb{Z}/(f)$, where $\pi$ denotes the natural projection. We claim that $\mathsf{ker}(\pi \circ \Phi) = \mathbb{Z}[f\omega]$, as we show.
($\subseteq$) If $\Phi(a+b\omega) = b$ $\equiv 0 \pmod f$, then $b = b^\prime f$ for some integer $b^\prime$. Thus $a + b\omega = a + b^\prime f \omega \in \mathbb{Z}[f\omega]$.
($\supseteq$) Clearly $\Phi(a+bf\omega) = bf \equiv 0 \pmod f$. By the First Isomorphism Theorem for groups, then, $\mathbb{Z}[\omega]/\mathbb{Z}[f\omega] \cong \mathbb{Z}/(f)$, hence $[\mathbb{Z}[\omega] : \mathbb{Z}[f\omega]] = f$.
Suppose now that $S \subseteq \mathbb{Z}[\omega]$ is a subring containing 1 and having finite index $f$. If $f = 1$, then trivially, $\mathbb{Z}[\omega] = \mathbb{Z}[1\omega]$. If $f \geq 2$, then since $1 \in S$, $\mathbb{Z} \subseteq S$, and in particular, $(f-1)a \in S$ for all integers $a$.
Let $a,b \in \mathbb{Z}$. Since $S$ has index $f$, $fxS = S$ for all $x \in \mathbb{Z}[\omega]$. (Here, $fx$ denotes the $f$-fold sum of $x$.) Specifically, $$f(a+b\omega)S = (fa + bf \omega)S = (f-1)aS + (a + bf\omega)S = (a+bf \omega)S;$$ thus $a + bf \omega \in S$ for all $a,b \in \mathbb{Z}$, and we have $\mathbb{Z}[f\omega] \leq S$.
Now $$f = [\mathbb{Z}[\omega] : \mathbb{Z}[f\omega]] = [\mathbb{Z}[\omega] : S] \cdot [S : \mathbb{Z}[f\omega]] = f \cdot [S : \mathbb{Z}[f\omega]].$$ Thus $[S : \mathbb{Z}[f\omega]] = 1$, and we have $S = \mathbb{Z}[f\omega]$.