I'm trying to comprehend a proof from my Elementary Number Theory course. Here, a quadratic integer $\theta$ is a solution of an equation of the form $x^2 + bx + c = 0$ with $b$ and $c$ integers.
Let $R = \mathbb{Z}[\theta]$ be a quadratic integer ring, and suppose that for every $a, b$ in $R$ not both zero, there exists a linear combination of $a$ and $b$ that divides both $a$ and $b$. Show that every irreducible element of $R$ is prime, so that unique factorization holds in $R$.
Official solution: Let $r$ be an irreducible element of $R$, and suppose that $r$ divides a product $s t$ of elements of $R$. We must show that $r$ divides $s$ or $r$ divides $t$. Suppose that $r$ does not divide $s$. By hypothesis, there is a linear combination $n r+m s$ (for some $n, m \in R)$ that divides both $r$ and $s ;$ since no associate of $r$ can divide $s, n r+m s$ must be a unit, which without loss of generality we can assume equal to 1. Then $1=n r+m s$, so $t=n r t+m s t$, and since $r$ divides nrt and $m s t$ we must have $r$ divides $t$.
I don't understand the line: ...is a linear combination $n r+m s$ (for some $n, m \in R)$ that divides both $r$ and $s ;$ since no associate of $r$ can divide $s, n r+m s$ must be a unit, which without loss of generality we can assume equal to 1. Why does "no associate of $r$ can divide $s$" imply that $n r+m s$ must be a unit? Also, is it correct that all units in quadratic integer rings are of form $\pm 1$?
Does showing that every irreducible element is prime imply that the ring we are working in is a UFD? How can I come to that conclusion? (I factor into irreducibles, and using the prime property I continuously "delete" the same irreducibles from both sides of the equation, thus we have unique factorization. I hope this is correct?)
Again, partial answers (answering only one of the questions) are very welcome! I will upvote them too. If there are any other solutions to the above problem, not necessarily following the official solution, then those are also very welcome! Thanks in advance!