Confusion about units in $\mathbb{Z}[\sqrt{d}]$ I'm a bit confused about units in $\mathbb{Z}[\sqrt{d}]$. For one, if $u$ is a unit, then it has an inverse $v$ and $uv=1$ so $N(uv)=N(u)N(v)=1$ which implies $N(u)=\pm 1$. This seems to be true no matter what $d$ is.
On the other hand, if $N(u)=\pm 1$, then $u\bar{u}=1$ so $u$ is a unit with inverse $\bar{u}$.
It seems that some values of $d$ are special, where the only units are $\pm 1$. In $\mathbb{Z}[\sqrt{-3}]$, if $u=a+b\sqrt{-3}$ is a unit then $N(u)=a^2+3b^2=\pm1$ which implies that $b=0$ and $a=\pm 1$, so $u=\pm 1$. On the other hand, in $\mathbb{Z}[\sqrt{6}]$, the element $5+2\sqrt{6}$ has norm $1$.
My questions are:

*

*For which $d$ are the only units $\pm 1$? It seems to work when $d<-1$.

*If $d>1$, are there always more than two units?

*Is it always true that $u$ is a unit $\iff$ $N(u)=\pm 1$?

 A: The answer to all your questions is "yes", with a small caveat for the second one: if $d\gt 1$ is not a square, then $\mathbb{Z}[\sqrt{d}]$ has infinitely many units. (if $d$ is a square, then $\mathbb{Z}[\sqrt{d}]=\mathbb{Z}$, which has only $1$ and $-1$ as units).
This comes from studying the so-called Pell Equation $x^2-dy^2=1$ (you can also invoke Dirichlet's Unit Theorem, but this is not needed here as it happens).
Assume that $d$ is not a square, so that $\mathbb{Z}[\sqrt{d}]\neq \mathbb{Z}$. Elements can be written uniquely as $a+b\sqrt{d}$ with $a,b\in\mathbb{Z}$ (this is where we are using that $d$ is not a square, so that $\sqrt{d}$ is not an integer).
The following answers your third question:
Theorem. Let $d$ be an integer, not a square. Define $N\colon\mathbb{Z}[\sqrt{d}] \to \mathbb{Z}$ by $N(a+b\sqrt{d}) = a^2-db^2$. Then $N(xy)=N(x)N(y)$ for all $x,y\in\mathbb{Z}[\sqrt{d}]$, and $x\in\mathbb{Z}[\sqrt{d}]$ is a unit if and only if $N(x)=\pm 1$.
Proof. The first part can be verified by direct calculation. If $x=a+b\sqrt{d}$ has norm $1$, then $a-b\sqrt{d}$ is its multiplicative inverse; if it has norm $-1$, then $-a+b\sqrt{d}$ is its multiplicative inverse. Conversely, if $y$ is the inverse, then $N(1) = 1 = N(x)N(y)$, so $N(x)=1$ or $N(x)=-1$. $\Box$
Proposition. Let $d$ be a negative integer. If $d\lt-1$ then the only units of $\mathbb{Z}[\sqrt{d}]$ are $\pm 1$. If $d=-1$, then the units of $\mathbb{Z}[\sqrt{d}] = \mathbb{Z}[i]$ are $\pm1$ and $\pm i$.
Proof. If $d\lt 0$ then there are no solutions to $x^2-dy^2=-1$, since the left hand side is always nonnegative. If $d\lt -1$, then $x^2-dy^2=1$ requires $y^2=0$, so $x=\pm 1$. And $x^2+y^2=1$ has solutions $(\pm 1,0)$ and $(0,\pm1)$, giving $\pm 1$ and $\pm i$. $\Box$
The following shows that for nonsquare positive $d$, there are always units other than $1$ and $-1$:
Theorem. If $d\gt 0$ is not a square, then $x^2-dy^2=1$ has at least one solution with $y\neq 0$.
Proof. See this post.  $\Box$
Any such solution gives the units $x\pm y\sqrt{d}$.
In fact, once you have any solution other than $\pm 1$, you get infinitely many solutions, since:
Theorem. If $(x_1,y_1)$ and $(x_2,y_2)$ are solutions to $x^2-dy^2=1$, with $d$ not a square, then so is $(x,y)$, where
$$x+y\sqrt{d} = (x_1+y_1\sqrt{d})(x_2+y_2\sqrt{d}).$$
Proof: We have
$$\begin{align*}
x^2 - dy^2 &= N(x+y\sqrt{d})\\
&= N(x_1+y_1\sqrt{d})N(x_2+y_2\sqrt{d})\\
&= (1)(1) = 1. \qquad\Box
\end{align*} $$
Now suppose that $a+b\sqrt{d}$ is a solution, with $b\neq 0$. We may assume that $b\gt 0$. Then so is $(a+b\sqrt{d})^k$ for every $k$; none of these are equal to $1$, since we must have $d\gt 0$ and the only real roots of unity are $1$ and $-1$. So the sequence $(a+b\sqrt{d})^k$ gives infinitely many distinct units in $\mathbb{Z}[\sqrt{d}]$. This gives a positive answer to your first and second question, once we add the assumption that $d$ is not a square.
Sometimes you get units with $N(u)=-1$, but sometimes you do not. For example, in $\mathbb{Z}[\sqrt{3}]$, we get no elements of norm $-1$: if $x$ and $y$ are integers, then $x^2-3y^2\equiv x^2\equiv 0,1\pmod{3}$, so we cannot have $x^2-3y^2=-1$.
The solutions to the equations $x^2-dy^2=\pm1$ with $d$ not a square are covered in LeVeque's Topics in Number Theory, volume 1, Section 8.2.
