TITLE: Showing that an integral domain is a PID if it satisfies two conditions
QUESTION [6 upvotes]: This is just a textbook problem from Dummit and Foote, but the issue is that our class barely touched on PIDs and the preceding material, so I don't really know or understand much.
Anyway,

Let $R$ be an integral domain.  If $R$ satisfies the following:

i. any two nonzero $a,b \in R$ have a gcd in the form of $d=ra+sb, r,s \in R$
ii. If $a_1, a_2,...$ are nonzero in $R$ such that $a_{i+1}$ divides $a_i$ for every $i$ then $\exists N \in \mathbb{Z}$ such that $a_n$ is an unit times $a_N$  $\forall n \ge N$, 

prove that $R$ is a principal ideal domain.

From what I've gathered, the second condition means that $(a_1) \subset (a_2) \subset...$ and $(a_N) = (a_n)$ $\forall n \ge N$.  However, I'm not sure what I should do now. I'm worried that I'm lacking the necessary context here especially since we used Artin pretty much all semester.
In short, my question is: how should I proceed with this proof given what I know?

REPLY [2 votes]: Here's a slightly different spin.

Condition i) says that given any two elements, $a,b$, there exists $d$ such that $(d)=(a,b)$. So, every $2$-generated ideal is principal.
By induction, you can use the last point to conclude that every finitely generated ideal of  $R$ is principal.
Condition ii) says that $R$ satisfies the ascending chain condition on principal ideals of $R$, but in view of the last point we can say more: the ascending chain condition for finitely generated ideals holds.
This allows us to show in fact that all ideals are finitely generated, for if an ideal $I$ had a minimal infinite generating set $x_1,x_2\dots$, then $(x_1)\subset(x_1,x_2)\subset\dots(x_1,x_2,x_3\dots)$ would be a strictly increasing chain of finitely generated ideals, which is forbidden by the last point. Thus $I$ had to be finitely generated to begin with.
But now recall that the finitely generated ideals are principal, so all ideals are finitely generated and now principal. Thus you have a PID.