Why is $\sqrt{4+2\sqrt{3}}-\sqrt{3}$ rational? For this question,

Show the following irrational-looking expressions are actually rational numbers.
(a) $\sqrt{4+2\sqrt{3}}-\sqrt{3}$, and
(b) ...

I solved it as follows:
$$\begin{align} x &= \sqrt{4+2\sqrt{3}}-\sqrt{3},\\
x+\sqrt{3} &= \sqrt{4+2\sqrt{3}},\\
(x+\sqrt{3})^{2} &= (\sqrt{4+2\sqrt{3}})^{2},\\
\end{align}\\
x^{2}+2\sqrt{3}x-(1+2\sqrt{3}) = 0,\\
(x-1)(x+(1+2\sqrt{3}))=0.$$
My question is that, there are two numbers satisfying $x = \sqrt{4+2\sqrt{3}}-\sqrt{3}$, but one of them is irrational. Then, how can we say $\sqrt{4+2\sqrt{3}}-\sqrt{3}$ is rational as a whole?

With respect to your written
note that $$\bf{x = \sqrt{4+2\sqrt{3}}-\sqrt{3}=\sqrt{4+\sqrt{12}}-\sqrt{3} > 0}$$
$$\begin{align} x &= \sqrt{4+2\sqrt{3}}-\sqrt{3},\\
x+\sqrt{3} &= \sqrt{4+2\sqrt{3}},\\
(x+\sqrt{3})^{2} &= (\sqrt{4+2\sqrt{3}})^{2},\\
\end{align}\\
x^{2}+2\sqrt{3}x-(1+2\sqrt{3}) = 0,\\
(x-1)(x+(1+2\sqrt{3}))=0.$$ now you have two roots ,but  $\bf{x >0}$
so
$$x-1=0 \to x=1 \checkmark \\x=-1-2\sqrt 3 <0 \times$$
