Ah! The Quadradic integers.

If p>0 then we have Z[sqrt(p)]={b+c*sqrt(b)}

We need to show that this structure forms a abelian group under addition.

Closure

(b+c*sqrt(p))+(b'+c'sqrt(p))=(b+b')+(c+c')sqrt(p)

Where (b+b') and (c+c') are integers.

Identity

b=0 and c=0.

Inverse

b=-b' and c=-c'

Associativitiy

Since C (complex numbers) are associate so are these.

Commutativity

Since C are abelian so are these.

Hence Z[sqrt(p)] form an abelian group under +.

We now show that Z[sqrt(p)] is closed under *.

Simple,

(a+bsqrt(b))*(a'+b'sqrt(p))=(aa'+bb'p)+(ab'+a'b)sq rt(p)

Where,

aa'+bb'p and ab+a'b are integers.

The last thing is two show that is is distributive.

Since C is distributive then so it Z[sqrt(p)]

When p<0 then actually it is undefined to take a squere root but anyway we define Z[sqrt(b)]=Z[a+ibsqrt(b)]

And use the same appraoch as above.