First: you cannot (and should not) assume that there are only $n$ classes; the number of equivalence classes is in fact infinite (uncountable!). Luckily, you don't need to assume that there are only $n$ classes, because linear combinations involve, by definition, only finitely many terms.
Second, you should not write "$a_1,a_2,\ldots,a_n\neq 0$" in general; in principle, you only know that not all of them are equal to $0$. Given an appropriate assumption (which you do not make) you may be able to reduce to the case in which all of them are nonzero.
Third: Your procedure will not work, because you are not excluding (in step 3) the possibility that we pick $0$ as the representative of the class that contains all rationals; but if we pick $0$, then we will certainly not get a basis.
Fourth: even if you exclude $0$, the desired conclusion is not true.
To see this, note first that $\sqrt{2}\not\sim\sqrt{3}$; indeed, if $\sqrt{2}\sim\sqrt{3}$, then there would exist a rational $q$ such that $\sqrt{2}=\sqrt{3}+q$. Then $2 = (\sqrt{3}+q)^2 = 3+q^2+2q\sqrt{3}$; but in order for this number to be rational, we need $2q\sqrt{3}$ to be rational, hence $q=0$, but this would give $\sqrt{2}=\sqrt{3}$, which is certainly not true. So $\sqrt{2}$ and $\sqrt{3}$ are in different classes. So we may pick $\sqrt{2}$ as one of our $x_i$, and $\sqrt{3}$ as another one.
But now I claim that $\sqrt{2}+\sqrt{3}$ is not in the class of $\sqrt{2}$, nor is it in the class of $\sqrt{3}$: indeed, $(\sqrt{2}+\sqrt{3}) - \sqrt{2}=\sqrt{3}\notin\mathbb{Q}$, so $(\sqrt{2}+\sqrt{3})\not\sim\sqrt{2}$, and likewise $(\sqrt{2}+\sqrt{3})-\sqrt{3}=\sqrt{2}\notin \mathbb{Q}$, so $\sqrt{2}+\sqrt{3}\not\sim \sqrt{3}$. Thus, $\sqrt{2}$, $\sqrt{3}$, and $\sqrt{2}+\sqrt{3}$ are in three different equivalence classes. So we may choose $\sqrt{2}$, $\sqrt{3}$, and $\sqrt{2}+\sqrt{3}$ as three different representatives, but they are not $\mathbb{Q}$-linearly independent. So your desired conclusion that the $x_i$ form a basis false.
(In fact, no matter what representatives you pick from the classes of $\sqrt{2}$, $\sqrt{3}$, and $\sqrt{2}+\sqrt{3}$, you will get a nontrivial linear combination equal to zero: if $x_1\sim \sqrt{2}$, $x_2\sim\sqrt{3}$, $x_3\sim\sqrt{2}+\sqrt{3}$, and $x_4\sim 1$, then let $q_1$, $q_2$, and $q_3$ be the rationals such that $x_1=\sqrt{2}+q_1$, $x_2=\sqrt{3}+q_2$, $x_3=(\sqrt{2}+\sqrt{3})+q_3$; then
$$ 0 = \sqrt{2}+\sqrt{3}-(\sqrt{2}+\sqrt{3}) = x_1 + x_2 - x_3 + \frac{(q_3-q_2-q_1)}{x_4}x_4$$
but not all coefficients are zero.)
They do, however, span $\mathbb{C}$ over $\mathbb{Q}$: to see this, let $c\in\mathbb{C}$ be arbitrary. Then there exists some $x_i$ in our set of representatives such that $c\sim x_i$, and hence, by definition, there exists a rational number $q$ such that $c = x_i+q$. Then letting $y$ be the representative from the class of all rationals, we have
$$c = x_i + \frac{q}{y}y;$$
since $y\neq 0$, this is possible, and $\frac{q}{y}\in\mathbb{Q}$, so this expresses $c$ as a linear combination of elements of $\{x_i\}$.