Find necessary and sufficent condition question In P.I.D $K$ give 2 elements $a,b$. Find necessary and sufficent condition that: "If $J$ is an ideal of $K$ that $(a) \subseteq J \subseteq (b) \text{ then } J=(a) \text{ or } J=(b)$".
My attempt: I have found the sufficent condition is $a$ is irreducible and $b \sim 1$ but i couldn't prove this is the necessary condition. 
Any help would be appreciated.  
 A: Here is my answer after take some suggestions. 
We will prove that
$$\left\{\begin{array}{ll}
a=bc (b,c\in K)\\
c \sim 1 \text{ or } c \text{ is irreducible}
\end{array}\right. \iff \text{ If } J \text{ is an ideal of } K \text{ that } (a) \subseteq J \subseteq (b) \text{ then } J=(a) \text{ or } J=(b) $$
$(\Rightarrow)$ Suppose that $\left\{\begin{array}{ll}
a=bc (b,c\in K)\\
c \sim 1 \text{ or } c \text{ is irreducible}
\end{array}\right.$ and $(a) \subseteq J \subseteq (b)$. We will prove that $J = (a)$ or $J=(b)$. Indeed,


*

*If $c\sim 1$ then $a=bc \sim b$. This yields $(a) = J = (b)$

*If $c$ is irreducible. 
There exist $d \in K$ that $J=(d)$ since $K$ is P.I.D. This yields $(a) \subseteq (d) \subseteq (b)$.
Since $(d) \subseteq (b)$,we have $b \mid d$. Thus, exist $e \in K$ that $d=be$. This yields $e \mid c$, since $d \mid a$.
Infer $e\sim 1$ or $e \sim c$, since $c$ is irreducible.
If $e \sim 1$ then $d \sim b$. This yields $(d)=(b)$ or $J=(b)$.
If $e \sim c$ then $d \sim bc=a$. This yields $(d)=(a)$ or $J=(a)$.
$(\Leftarrow)$ Suppose that $\text{ If } J \text{ is an ideal of } K \text{ that } (a) \subseteq J \subseteq (b) \text{ then } J=(a) \text{ or } J=(b)$.
Since $(a) \subseteq (b)$, we have $b \mid a$. Thus, exist $c \in K$ that $a=bc$. There are only 2 cases


*

*If $c \sim 1$, we end proof.

*If $c \nsim 1$. We will prove that $c$ is irreducibe.
Suppose reversely that $c$ is reducible then we can write $c=q_1q_2$ with $q_1$ is irreducible (it means $q_1$ is non-trivial factor of $c$ in $K$).
This yields $a=bc=bq_1q_2$.
Thus,$(a) \subseteq (bq_1) \subseteq (b)$.
Hence, $(bq_1) = (a)$ or $(bq_1)=(b)$.


*

*If (bq_1) = (a) then $bq_1 \sim a$.


This yields $q_1 \sim c$ (conflict with the way we choose $q_1$)


*If (bq_1) = (b) then $bq_1 \sim b$.


This yields $q_1 \sim 1$ (conflict with the way we choose $q_1$)
So $c$ is irreducible.
