Let $K$ be an algebraic number field of degree $n$. Let $\mathcal{O}_K$ be the ring of algebraic integers. Let $R$ be an order of $K$, i.e. a subring of $K$ which is a free $\mathbb{Z}$-module of rank $n$. Let $\alpha_1, \cdots, \alpha_n$ be a basis of $R$ as a $\mathbb{Z}$-module. Let $D =$ det$(Tr_{K/\mathbb{Q}}(\alpha_i\alpha_j))$. It is easy to see that $D$ is independent of a choice of a basis of $R$. We call $D$ the discriminant of $R$. Let $I$ be an ideal of $R$. Let $\mathfrak{f} = \{x \in R | x\mathcal{O}_K \subset R\}$. If $I + \mathfrak{f} = R$, we call $I$ regular. Since regular ideals have nice properties as shown here, it is desirable to have a handy criterion of whether a given ideal of $R$ is regular or not. I came up with the following proposition.
Proposition Let $K$ be a quadratic number field, $d$ its discriminant. Let $R$ be an order of $K$, $D$ its discriminant. It is easy to see that there exists an integer $f \gt 0$ such that $D = f^2d$. Let $I$ be a non-zero ideal of $R$. By the result of this question, there exist unique integers $a, b, c$ such that $I = \mathbb{Z}a + \mathbb{Z}(b + c\frac{(D+ \sqrt D)}{2}), a \gt 0, c \gt 0, 0 \le b \lt a, a \equiv 0$ (mod $c$), $b \equiv 0$ (mod $c$). Then $I$ is regular if and only if gcd$(a, f) = 1$.
Outline of my proof I used the result of this question and this question. A full proof was posted as an answer below.
My question How do you prove the proposition? I would like to know other proofs based on different ideas from mine. I welcome you to provide as many different proofs as possible. I wish the proofs would be detailed enough for people who have basic knowledge of introductory algebraic number theory to be able to understand.
Let $K, R, f$ be as in the proposition. By this question, $f$ is the order of the group $\mathcal{O}_K/R$. Hence, by this question, $\mathfrak{f} = f\mathcal{O}_K$
Lemma 1(Lying-over theorem) Let $B$ be a commutative ring. Let $A$ be a subring of $B$. Suppose $B$ is integral over $A$. Let $P$ be a prime ideal of $A$. Then there exists a prime ideal $Q$ of $B$ lying over $P$, i.e. $P = Q \cap A$.
Proof: See any introductory textbook on commutative algebra or Lemma 7.33.15 of this online book.
Lemma 2 Let $R$ be an order of an algebraic number field. Let $I$ be a non-zero ideal of $R$. Then $R/I$ is a finite ring.
Proof: Let $\alpha$ be a non-zero element of $I$. Since $\alpha R \subset I$, $I$ is a free $\mathbb{Z}$-module of the same rank as $R$. Hence $R/I$ is a finite ring.
Lemma 3 Let $R, f$ be as in the proposition. Let $P \ne 0$ be a prime ideal of $R$. Suppose $f \in P$. Then $f\mathcal{O}_K \subset P$.
Proof: By Lemma 1, there exists a prime ideal $Q$ of $\mathcal{O}_K$ lying over $P$. Then $f\mathcal{O}_K \subset Q$. Since $f\mathcal{O}_K$ is an ideal of $R$, $f\mathcal{O}_K \subset Q \cap R = P$.
Lemma 4 Let $R, f$ be as in the proposition. Let $P \ne 0$ be a prime ideal of $R$. Then $P$ is regular if and only if $P$ does not contain $f$.
Proof: By Lemma 2, $R/P$ is a field. Hence $P$ is a maximal ideal of $R$.
Suppose $P$ is not regular. Then $P + f\mathcal{O}_K \ne R$. Hence there exists a maximal ideal $M$ of $R$ such that $P + f\mathcal{O}_K \subset M$. Since $P$ is maximal, $P = M$. Hence $f \in P$.
Conversely suppose $f \in P$. By Lemma 3, $P$ is not regular. QED
Lemma 5 Let $R, f$ be be as in the proposition. Let $I$ be a non-zero ideal of $R$. Then $I$ is regular if and only if every prime ideal $P$ containing $I$ is regular.
Proof: Suppose $I$ is regular. Let $P$ be a prime ideal of $R$ containing $I$. Suppose $P$ is not regular. By Lemma 4, $f \in P$. Then $f\mathcal{O}_K \subset P$ by Lemma 3. Hence $I + f\mathcal{O}_K \subset P$. Hence $I$ is not regular. This is a contradiction.
Conversely suppose $P$ is a non-regular prime ideal containing $I$. Since $I + f\mathcal{O}_K \subset P + f\mathcal{O}_K \ne R$, $I$ is not regular. QED
Proof of the proposition Let $a = ca', b = cb'$. Then $I = cJ$, where $J = \mathbb{Z}a' + \mathbb{Z}(b' + \omega)$.
Suppose $I$ is regular. We claim that gcd$(a, f) = 1$. Suppose this is not the case. Let $p$ be a prime divisor of gcd$(a, f)$. We first consider the case that $c$ is divisible by $p$. By Lemma 1, there exists a prime ideal $P$ lying over $p$. Since $c \in P$, $I \subset P$. Since $P$ is not regular by Lemma 4, $I$ is not regular by Lemma 5. This is a contradiction. Nexe we consider the case that $a'$ is divisible by $p$. Since $I \subset J$, $J$ is regular. Hence, by this question, there exists a prime ideal $P$ dividing $J$ and lying over $p$. Since $P$ is not regular by Lemma 4, $I$ is not regular by Lemma 5. This is a contradiction. Hence gcd$(a, f) = 1$.
Conversely suppose $I$ is not regular. By Lemma 5, there exists a non-regular prime ideal $P$ such that $I \subset P$. Let $p$ be the unique prime number such that $p\mathbb{Z} = P \cap \mathbb{Z}$. Since $P$ is non-regular, $f$ is divisible by $p$ by Lemma 4. Since $a \in I \subset P$, $a$ is divisle by $p$. Hence gcd$(a, f)$ is divisible by $p$. QED