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.