Show that $a + b\sqrt{n}$ is an irreducible element of $\mathbb{Z}[\sqrt{n}]$ Let $n(\neq 0,1)$ be a square-free integer. Suppose that $|a^2 - nb^2|$ is a prime integer for $a,b \in \mathbb{Z}$. Show that $a + b\sqrt{n}$ is an irreducible element of $\mathbb{Z}[\sqrt{n}]$. Then, show that $p = |a^2-nb^2|$ is not irreducible in $\mathbb{Z}[\sqrt{n}]$. 
I can't prove the first part. I think the question is a bit un clear too. Are all $a + b\sqrt{n}$ is an irreducible element of $\mathbb{Z}[\sqrt{n}]$? Or just those with norm being a prime? For the second, I find it weird because i thought all primes in an integral domain is irreducible. Is $\mathbb{Z}[\sqrt{n}]$ not an integral domain? If so, can someone give me an example of a zero divisor in $\mathbb{Z}[\sqrt{n}]$ or a proof of $\mathbb{Z}[\sqrt{n}]$ not being an integral domain?
Thanks.
My attempt:
Claim 1
$N((a+b\sqrt{n})(c+d\sqrt{n}) = N(a+b \sqrt{n})N(c+d\sqrt{n})$
Proof
\begin{align*}
& N((a+b\sqrt{n})(c+d\sqrt{n}) \\
&=  N((ac + bdn) + (ac + bd)\sqrt{n}) \\
&=  |(ac+bdn)^2 - n(ac+bd)^2| \\
&= |(a^2c^2 + 2abcdn + b^2d^2n^2) - n(a^2c^2 + 2abcd + b^2d^2)| \\
&= |a^2c^2 + 2abcdn + b^2d^2n^2 - a^2c^2n - 2abcdn - b^2d^2n| \\
&= |a^2c^2 + b^2d^2n^2 - a^2c^2n - b^2d^2n| \\
&= |(a^2 - nb^2)(c^2 - nd^2)| \\
&= |a^2 - nb^2||c^2 - nd^2)| \\
&= N(a+b\sqrt{n})N(c+ d \sqrt{n})
\end{align*}
Claim 2.
$a+b\sqrt{n}$ is a unit in $\mathbb{Z}[\sqrt{n}]$ if and only if $N(a+b\sqrt{n}) = 1$.
Proof
Since $a+b\sqrt{n}$ is a unit in $\mathbb{Z}[\sqrt{n}]$, we can find $(c+d \sqrt{n}) \in \mathbb{Z}[\sqrt{n}]$ such that $(a+b\sqrt{n})(c+d \sqrt{n}) = 1$. This gives us $N(a+b\sqrt{n})N(c+ d \sqrt{n}) = N((a+b\sqrt{n})(c+d \sqrt{n})) = N(1) = 1$. From the way the norm is defined, $N(a+b\sqrt{n}) \geq 0$ and $N(c+ d \sqrt{n}) \geq 0$. Therefore, we must have $N(a+b\sqrt{n}) = 1$ and $N(c+ d \sqrt{n}) = 1$. 
I am having trouble proving the other direction
Proof for the question
First part
Suppose $a + b\sqrt{n}$ is reducible in $\mathbb{Z}[\sqrt{n}]$, then $a + b\sqrt{n} = (\alpha_1 + \beta_1 \sqrt{n})(\alpha_2 + \beta_2 \sqrt{n})$ for some non-units $\alpha_1 + \beta_1 \sqrt{n}, \alpha_2 + \beta_2 \sqrt{n} \in \mathbb{Z}[\sqrt{n}]$. This gives us $ |a^2 - nb^2| = N(a + b\sqrt{n}) = N(\alpha_1 + \beta_1 \sqrt{n})(\alpha_2 + \beta_2 \sqrt{n}) = N(\alpha_1 + \beta_1 \sqrt{n})N(\alpha_2 + \beta_2 \sqrt{n})$. By claim 2, $N(\alpha_1 + \beta_1 \sqrt{n}) \neq 1$ and $N(\alpha_2 + \beta_2 \sqrt{n} \neq 1$ as $\alpha_1 + \beta_1 \sqrt{n}, \alpha_2 + \beta_2 \sqrt{n}$ are non-units. This implies that $N(\alpha_1 + \beta_1 \sqrt{n}) = p$ and $N(\alpha_2 + \beta_2 \sqrt{n}) = p$ as $p$ is prime. This presents us with a contradiction as $p = N(a + b\sqrt{n}) =  N(\alpha_1 + \beta_1 \sqrt{n})N(\alpha_2 + \beta_2 \sqrt{n}) = p^2$. Hence, $a + b\sqrt{n}$ is irreducible in $\mathbb{Z}[\sqrt{n}]$.
Second part
If $p$ is irreducible in $\mathbb{Z}[\sqrt{n}]$, then if $p = ab$ for some $a,b \in \mathbb{Z}[\sqrt{n}]$, $a$ is a unit or $b$ is a unit . This gives us $p^2 = N(p) = N(a)N(b)$. If $a$ is a unit, then $N(b) = p^2$.
I don't know how to continue
If $|ab| \neq |a||b|$, then my proof probably fail, but i think this is true.

Note that $(a^2-nb^2)(c^2-nd^2)=(ac+bdn)^2-n(ad+bc)^2$, which is the multiplicativity of norms, related to $(a-b\sqrt n)(c-d\sqrt n)=(ac+bdn)-(ad+bc)\sqrt n$.
Suppose you have a factorisation $a-b\sqrt n=(c-d\sqrt n)(e-f \sqrt n)$ then you also have $$\pm p=a^2-nb^2=(c^2-nd^2)(e^2-nf^2)$$ and this is a factorisation in $\mathbb Z$, so one of the factors, say the first, must be $\pm 1$.
This then gives $(c-d\sqrt n)(c+d\sqrt n)=c^2-nd^2=\pm 1$ so that $c-d\sqrt n$ is a unit (we have found an explicit multiplicative inverse).
For the second part $\pm p=(a+b \sqrt n)(a-b\sqrt n)$
Suppose $1=(a\pm b\sqrt n)(c\pm d\sqrt n)=(ac+bdn)\pm (ad+bc)\sqrt n$ (taking the same sign both times) so that one factor is a unit. We know that $n$ is square free, so $\sqrt n$ is irrational. But this equation expresses $\sqrt n$ as a rational number unless $ac+bdn=1$ and $ad+bc=0$. Let $q=c^2-nd^2$
Now we have $\pm pq=(a^2-nb^2)(c^2-nd^2)=(ac+bdn)^2-n(ad+bc)^2=1$ which is a contradiction in $\mathbb Z$ because $p$ is not a unit (and we cannot, from this equation, have $q=0$).
The language of norms codifies such calculations. The fact that norms are multiplicative allows us to take questions about factorisation from a quadratic ring (or ring of integers in any number field) into $\mathbb Z$. It is important at this stage to get an accurate understanding of what is happening here. It is particularly useful to note that the formula for the norm gives an explicit inverse for an element of norm $\pm 1$ and therefore a direct proof that an element of norm $\pm 1$ is a unit.
Note that it is not necessarily true that a prime in $\mathbb Z$ is a prime in the quadratic field. If we set $n=-1$, for example, we find $2=i(1-i)^2$ where $i$ is a unit, and $5=(1+2i)(1-2i)$. The prime $5$ splits into two distinct factors, while the double factor for $2$ is an example of "ramification". It turns out that this is a significant difference.
