Let $N_{1}$ be the set of all positive integer greater than $1$.Let $n \in N_{1}$ is square free. Let us consider $\mathbb Z [\sqrt{n}] = \{a + b {\sqrt{n}} : a,b \in \mathbb Z \}$, for some square free positive integer $n \in N_{1}$.Then prove that an element $a + b {\sqrt{n}}$ of $\mathbb Z [\sqrt{n}]$ is irreducible if $|a^{2} - nb^{2}|$ is a prime number.
My attempt :
Let $a + b {\sqrt{n}} \in \mathbb Z [\sqrt{n}]$ such that $|a^{2} - nb^{2}|$ is a prime number, say $p$.Now if $a + b {\sqrt{n}} = (c + d {\sqrt{n}})(e + f {\sqrt{n}})$, then $a = ce + ndf$ and $b = cf + de$.Thus $p = |a^{2} - nb^{2}| = |(ce + ndf)^{2} - n(cf + de)^{2}| = |c^{2}e^{2} + 2ncdef + n^{2}d^{2}f^{2} - n(c^{2}f^{2} + 2cdef + d^{2}e^{2}| =|(c^{2} - nd^{2})(e^{2} - fd^{2})| = |c^{2} - nd^{2}||e^{2} - nf^{2}|$. Since $p$ is prime we have either $|c^{2} - nd^{2}| = 1$ or $|e^{2} - nf^{2}| = 1$.If $|c^{2} - nd^{2}| = 1$, then we have $|(c + d {\sqrt{n}})(c - d {\sqrt{n}})| = 1$ which implies $c + d {\sqrt{n}}$ is a unit where $(c + d {\sqrt{n}})^{-1} = c - d {\sqrt{n}}$ or $-(c - d{\sqrt{n}})$.Similarly if $|e^{2} - nf^{2}| = 1$ it can be shown that $e + f {\sqrt{n}}$ is a unit.Consequently $a + b {\sqrt{n}}$ is irreducible.
I think it's ok, but there is a problem here. I can't use the fact that $n$ is square-free. Why is it important? Please tell me.
Thank you in advance.