Let $D$ be a squarefree integer, and let $\mathcal{O}$ be the ring of integers in the quadratic field $\mathbb{Q}(\sqrt{D})$. For positive integer $f$ define the order of conductor $f$, $\mathcal{O}_f$ by $$ \mathcal{O}_f = \mathbb{Z}[f\omega] = \{ a + bf\omega \mid a,b \in \mathbb{Z} \}, $$
where
$$\omega = \begin{cases} \sqrt{D} & \text{if } D \equiv 2 \text{ or } 3 \pmod 4 \\ \frac{1+\sqrt{D}}{2} & \text{if } D \equiv 1 \pmod 4. \end{cases}$$
In this case $\mathcal{O}_f$ is a subring of $\mathcal{O}$. I would like to prove $[ \mathcal{O}: \mathcal{O}_f] = f$ (where the index is as additive abelian groups).
I'm not sure how to go about this. A first step that seems logical is to write $\varphi: \mathcal{O} \to \mathbb{Z}$ defined by $\varphi (a+b\omega) = b$. This map is then a surjective group homomorphism. I'm not entirely sure how to proceed. Any detailed solution would be welcome since I'm a bit lost on this section of the textbook I am working on.
Note that $f\omega\in\mathcal{O}_{f}$. Let $c$ be the smallest positive integer such that $c\omega\in\mathcal{O}_{f}$. By division algorithm, there exists $q,r\in\mathbb{Z}$ such that $f=cq+r,0\leq r <c$. Since $\mathcal{O}_{f}$ is a ring, $r\omega=(f-cq)\omega\in\mathcal{O}_{f}$. Thus $r$ must be $0$, i.e., $f$ is a multiple of $c$. Write $c\omega=a+bf\omega$. Since $1$ and $\omega$ are $\mathbb{Z}$-linearly independent, we have $a=0,c=bf$, in particular, $c$ is a multiple of $f$. Since $c$ and $f$ are positive integers, $c=f$.
Now define $\phi : \mathcal{O}\longrightarrow\mathbb{Z}/f\mathbb{Z}$ as follows:
Let $\alpha\in\mathcal{O}$ and write $\alpha=a+b\omega$. By division algorithm, $\exists ! q,r$ such that $b=fq+r,0\leq r <f$. Set $\phi(\alpha)=r\pmod{f}$. Then one can show that $\phi$ is a group homomorphism. Let $r\pmod{f}\in\mathbb{Z}/f\mathbb{Z}$ Then $\alpha:=r\omega\in\mathcal{O}$ and $\phi(\alpha)=r\pmod{f}$. Suppose that $\phi(a+b\omega)=0$ in $\mathbb{Z}/f\mathbb{Z}$. By construction, this is equivalent to $b$ is a multiple of $f$. Hence, $\ker(\phi)=\mathcal{O}_f$. This proves that $[\mathcal{O}:\mathcal{O}_{f}]=f$.