Proving a subring of $\mathbb{Q}$ containing $\mathbb{Z}$ is a PID Let $S$ be a subring of $\mathbb{Q}$ containing $\mathbb{Z}$. Prove that it is a principal ideal domain.
So here is what I tried. Take any ideal $I\subset S$. Take any two elements, say $a=p/q, b=r/s$ in $I$. Rationalize denominators (we can do that since $\mathbb{Z}\subset S$. Now we have $aqs=p=K(r)=K(bqs)+R$, that is, just apply the Euclidean Algorithm. Now, $a-Kb=R/qs\in I$, so take the set of all such remainders $R/qs$. 
There are two possibilities. Either this set has a smallest positive element, or it does not. 
Suppose it has a smallest such element, call it $x=m/n$. Let $a=p/q\in I$. We show $a=lx$. For suppose not. Rationalizing denominators with $n, q>1$, $p=Lm+Z$, so then $Z<m$ so $Z/qn<m/n=x$, giving a contradiction. 
Now though, I am stuck on the case where there is no such smallest element :(
Any thoughts?
EDIT: For those marking it as a duplicate: The first answer in the linked question, as mentioned in the comments, feels somewhat unnatural and requires all this extra machinery. On the other hand, the second answer given is incomplete: The poster says "Now show that the ideal generated by $t=\frac{t}{1}$ in R is the ideal you started out with." But if $\frac{r}{s}\in I$, then there exists $k$ such that $r=kt$, so $\frac{r}{s}=\frac{k}{s}\cdot \frac{t}{1}$, but $\frac{k}{s}$ is not necessarily in $S$. 
 A: Let $\mathbb{Z} \subsetneq A \subsetneq \mathbb{Q}.$ So there are some elements $n \in \mathbb{Z}, n \neq \pm 1$ which are invertible in $A,$ i.e. $\frac{1}{n} \in A.$ 
Let $n = p_1^{\alpha_1}p_2^{\alpha_2} \cdots p_r^{\alpha_r}$ be the prime factorization (up to units $\pm 1$). Then it is clear that $\frac{1}{p_i} \in A, \forall i = 1, 2, \cdots , r.$ 
Let $S$ be a multiplicatively closed subset of $\mathbb{Z}$ generated by all the primes $p \in \mathbb{Z}$ such that $\frac{1}{p} \in A.$ Then it's easy to show that 
$A = S^{-1}\mathbb{Z}.$ It is a well known fact (see e.g. Atiyah-McDonald, An Introduction to Commutative ALgebra, Chapter 3, Proposition 3.11) that every ideal of $S^{-1}\mathbb{Z}$ is of the 
form $S^{-1}I$ for some ideal $I$ of $\mathbb{Z}.$ So it remains to show that $S^{-1}I$ is principal. Let $I = \langle a \rangle.$ Then every element of $S^{-1}I$ is of the form 
$\frac{ar}{s}$ for some $r \in \mathbb{Z}, s \in S.$ Now $\frac{ar}{s} = \frac{r}{s} \cdot\frac{a}{1} \Rightarrow S^{-1}I = \langle \frac{a}{1} \rangle.$
In case you don't want to use the language of localization, you can always cheat as follows: 
Let $\mathbb{Z} \subsetneq A \subsetneq \mathbb{Q}.$ So there are some elements $n \in \mathbb{Z}, n \neq \pm 1$ which are invertible in $A,$ i.e. $\frac{1}{n} \in A.$ 
Let $n = p_1^{\alpha_1}p_2^{\alpha_2} \cdots p_r^{\alpha_r}$ be the prime factorization (up to units $\pm 1$). Then it is clear that $\frac{1}{p_i} \in A, \forall i = 1, 2, \cdots , r.$ 
This also says that, if $\frac{1}{m}, \frac{1}{n} \in A$ then $\frac{1}{mn} \in A.$ Note also that whenever $\frac{a}{b} \in A, \frac{1}{b} \in A.$ To see this, assune that gcd$(a, b) = 1.$ 
Write $ax + by =1$ for some $x, y \in \mathbb{Z}.$ So $\frac{1}{b} = \frac{a}{b} \cdot x + y \in A.$ Now let $I^c$ denotes the ideal $I \cap \mathbb{Z}$ and let's denote, by $J^e$, extension of an ideal 
$J \subset\mathbb{Z}$ in $A.$ Obviously, $I^{ce} \subseteq I.$ We want prove the reverse inclusion. Let $\frac{m}{n} \in I.$ Then $\frac{m}{1} = n \cdot \frac{m}{n} \in I \Rightarrow 
m \in I^c.$ But then $\frac{m}{1} \in I^{ce}$ and $\frac{m}{n} =  \frac{m}{1} \cdot \frac{1}{n} \in I^{ce}.$ Hence $I = I^{ce}.$ Now use the same argument as above.
