For what rational d is $\mathbb{Q}[\sqrt{d}]$ a field? Let $\mathbb{Q}$ be a field of rational numbers and d $\in \mathbb{Q}$. 
Consider the set $\mathbb{Q}[\sqrt{d}] := \{a + b\sqrt{d} \mid a,b \in \mathbb{Q}\}$ and define operations:
\begin{gathered}
(a + b\sqrt{d}) + (a' + b'\sqrt{d}) := (a + a') + (b + b')\sqrt{d}\\
(a + b\sqrt{d}) * (a' + b'\sqrt{d}) := (aa' + dbb') + (ab' + a'b)\sqrt{d}
\end{gathered}
It's easy to check that $\mathbb{Q}[\sqrt{d}]$ is a commutative ring with identity $1 := 1 + 0\sqrt{d}$. 
For some $d$ we can define an operation of taking inverse of non-zero elements. For what d does this hold?
 A: $\mathbb Q[d]$ is a field for all $d\in\mathbb Q$. To find the inverse of an element $a+b\sqrt d$, you can use exactly the same trick you use to find the inverse of a complex number:
$$\frac 1 {a+b\sqrt d}=\frac {a-b\sqrt d}{(a-b\sqrt d)(a+b\sqrt d)}=\frac{a-b\sqrt d}{a^2-db^2}=\frac{a}{a^2-db^2}+\frac{-b}{a^2-db^2}\sqrt d$$
That is to say, since we know that the inverse definitely exists in $\mathbb C$, or even in $\mathbb R$ is $d$ is positive, the above reasoning shows that it is in fact in $\mathbb Q[\sqrt d]$.
A: If you define $\mathbb{Q}[\sqrt{d}]$ as the set of symbols $a + b\sqrt{d}$, two such symbols $a + b\sqrt{d}, a' + b'\sqrt{d}$ being equal iff $a = a'$, $b = b'$, with the given operations (alternatively, you have the set of pairs $(a, b)$, with the given operations), then the answer is: this is a field iff $d$ is not a perfect square in $\mathbb{Q}$.
In fact if $d = u^{2}$ for some $u \in \mathbb{Q}$, you have
$$
(u - \sqrt{d}) (u + \sqrt{d}) = u^{2} - d = 0, 
$$
so $\mathbb{Q}[\sqrt{d}]$ is not even a domain.
If $d$ is not a square in $\mathbb{Q}$, then the argument in another answer shows that you get a field.
