Finding units of $\mathbb{Z}[\delta]$ with $\delta=\frac{1+\sqrt{d}}{2}$ and $d\equiv 1\pmod{4}.$ Let $d$ be a square free integer congruent to 1 modulo 4. Let
$$\delta=\frac{1+\sqrt{d}}{2}$$
(a) Prove that the subset $\mathbb{Z}[\delta]$ of the complex numbers defined here
$$\mathbb{Z}[\delta]:=\left\{a+b\delta:a,b\in\mathbb{Z}\right\}$$
is a subring.
(b) Assume that $d$ is negative. Prove that the units of $\mathbb{Z}[\delta]$ are only $\left\{\pm 1\right\}$, unless $d=-1$ or $-3$ dwhere the units are $\left\{\pm 1,\pm i\right\}$ and $\left\{\pm 1,\pm w\pm w^2\right\}$, respectively, where $w=\frac{-1+\sqrt{-3}}{2}$ is a non-trivial third root of unity.
For (a), I can't prove that $\mathbb{Z}[\delta]$ is closed under multiplication...
My solution for (b)
(b) Let $d\equiv 1\pmod{4}$ with $d\neq -3,-1$. Let $N:\mathbb{Z}[\delta]-\left\{0\right\}\to\mathbb{N}$ norm by $$N(a+b\delta)=(a+b\delta)(a+b\overline{\delta})$$
where $\overline{\delta}=\frac{1-\sqrt{d}}{2}$.
We will use it in a way that is in the domain of integrity $R$ it holds that $\forall r\in R^{\times}\Leftrightarrow  N(r)=1$.
Let $a+b\delta\in\mathbb{Z}[\delta]^{\times}$. Then
\begin{align*}1&=N(a+b\delta)\\
&=(a+b\delta)(a+b\overline{\delta})\\
&=a^2+ab\overline{\delta}+ab\delta+b^2\delta\overline{\delta}\\
&=a^2+ab+b^2(\frac{1-d}{4})
\end{align*}
If $d\equiv 1\pmod{4}$ then $1-d=4q$ some $q\in\mathbb{N}$ because $d$ is negative. Therefore we have to
$$1=a^2+ab+b^2q.$$
If $ab\geq 0$, $1=a^2+ab+b^2q\geq a^2+b^2$ then $a=\pm 1\wedge b=0\vee a=0\wedge b=\pm 1$. But, if $a=0\wedge b=\pm 1$ then $1=q$. This implies that $1-d=4$ i.e. $d=-3$ a contradiction.
If $ab<0$ then $1=a^2+ab+b^2q=a^2+2ab+b^2+b^2(q-1)-ab=(a+b)^2-ab+b^2(q-1)$ then $1+ab=(a+b)^2+b^2(q-1)$. Since $(a+b)^2+b^2(q-1)\geq 0$ and $1+ab\leq 0$ it must be fulfilled that
$(a+b)^2+b^2(q-1)=0$ then $a+b=0\wedge b^2(q-1)=0$. If $b=0$, $a=0$ a contradiction because $a+b\delta\neq 0$.
Therefore $a=-b\wedge q=1\wedge b\neq 0$. Then $1-a^2=0$ implies $a=\pm 1$.
Therefeore $a+b\delta=\pm 1$. It is also evident that
$\pm 1\in\mathbb{Z}[\delta]^{\times}$. It is concluded that
$\mathbb{Z}[\delta]^{\times}=\left\{\pm 1\right\}$.
How would it be with the case $d = -1$ or $d = -3$? I can't do something similar.
Actualization 2. If $d=-1$ then $1=a^2+ab+\frac{b^2}{4}$. Now, I want proves that
$a = \pm 1, b = 0$ or $a = -1, b = 2$ or $a = 1, b = -2$
Actualization 3. If $d=-1$ in an earlier step we got the equation
$$1=a^2+ab+b^2(\frac{1-d}{4})$$
If $d=-1$ we have that
$$1=a^2+ab+\frac{b^2}{2}$$
From the latter, if
$b=0$ is obtained
$a=\pm 1$.
If $b\neq 0$, as $b=\pm \sqrt{2-a^2}-a$. and $2-a^2\geq 0$ you should have to
$a=1$ and $b=-1$ or $a=-1$ and $b=1$.
Therefore , $\mathbb{Z}[\delta]^{\times}\subset \left\{\pm 1,\pm 1\mp 2\delta\right\}$ moreover $\pm 1\mp 2\delta=\pm 1\mp 2(\frac{1+i}{2})=\pm 1\mp(1+i)=\pm i$. Finally, with $N(\pm 1), N(\pm i)=1$ the equality holds.
Actualization 3. If $d=-3$ I have this:
If $b=0$ then $a=\pm 1$
If $b\neq 0$, $b=\frac{1}{2}(\pm \sqrt{4-3a^2}-a)$ then $4-3a^2\geq 0$, so $a\in \left\{0,\pm 1\right\}$
If $a=0$ then $b=\pm 1$
If $a=\pm 1$ then $b=\mp 1$, respectively.
Therefore, $\pm \delta$ and $\pm 1\mp \delta\in (\mathbb{Z}[\delta])^{\times}$ with $\delta=\frac{1+\sqrt{-3}}{2}.$
The problem is that in the statement, it is mentioned that
$(\mathbb{Z}[\delta])^{\times}\left\{\pm 1,\pm w\pm w^2\right\}$ different from what I found.

Hint for (a): $$\delta^2={d+1+2\sqrt d\over4}={d-1\over4}+\delta$$
