If $\mathbb{Q}(\sqrt{d}) = \mathbb{Q}(\sqrt{d'})$, with $d,d'$ squarefree integers, then there exist $r,s\in\mathbb{Q}$ such that $\sqrt{d}=r+s\sqrt{d'}$. Squaring both sides we get
$$d = r^2+s^2d' + 2rs\sqrt{d'}.$$
That means that $rs=0$. If $r=0$, then writing $s=\frac{a}{b}$, $a,b\in\mathbb{Z}$, $\gcd(a,b)=1$, we have
$$\begin{align*}
d &= s^2d'\\
b^2d &= a^2d'.
\end{align*}$$
Thus, $b^2|a^2d'$. Since $\gcd(b^2,a^2)=1$, $b^2|d'$. Since $d'$ is squarefree, $b^2=1$. Thus, $s=a\in\mathbb{Z}$. But then $d=a^2d'$, and since $d$ is squarefree, $a^2=1$. Thus, $d=d'$.
If $s=0$, we get $d=r^2$, and since $d$ is squarefree this means $d=1$. But then $\mathbb{Q}(\sqrt{d'}) = \mathbb{Q}$, so $\sqrt{d'}\in\mathbb{Q}$, which means $d'$ is a square; being squarefree, we have $d'=1=d$.