Proving that if $x_1,\dots,x_n$ are rational numbers and $\sqrt{x_1}+\dots\sqrt{x_n}$ is rational, then each $\sqrt{x_i}$ is rational as well
Here I show how to generalize the argument you gave for $\,n=2\,$ to general n. It uses very simple field theory. Since you remark in a comment that you are in high-school so wish to avoid field theory I will explain what's needed below, and work through a special case of the linked proof for motivation.
As with many inductive proofs, they key is to strengthen the inductive hypothesis, which here means proving the statement not only for rational numbers $\,\Bbb Q\,$ but also for larger "number systems" of real numbers that are obtained by adjoining square roots of positive numbers.
For example $\,\Bbb Q(\sqrt 5)\,$ denotes the reals obtainable by (field) arithmetic on rationals $\,\Bbb Q\,$ and $\,\sqrt 5\,$, where field arithmetic consists of the operations of addition, multiplication and division $\,a/b,\, b\neq 0.\,$ It is easy to show that the reals obtainable by iterating these operations are exactly those writable in the form $\,a+b\sqrt{5}\,$ for $\,a,b\in \Bbb Q\,$ (for division we can rationalize the denominator). We can iterate this construction, e.g. adjoining $\,\sqrt 3\,$ to $\,F = \Bbb Q(\sqrt 5)$ to get $\,F(\sqrt 3)\,$ with numbers $\,a+b\sqrt 3\,$ for $\,a,b\in \Bbb Q(\sqrt 5)$. This step-by-step construction of such towers of number systems proves very handy for inductive proofs (a special case of structural induction).
For motivation, we show how the induction step works to reduce the case $n=3$ to $n=2$ (your result). The induction step in the general proof works exactly the same way.
Suppose $\sqrt 2 + \sqrt 3 + \sqrt 5 = q\in \Bbb Q.\,$ It suffices to show one summand $\in \Bbb Q\,$ since then the sum of the other two is in $\,\Bbb Q\,$ so induction (your $n=2$ proof) shows they too are in $\,\Bbb Q$.
$\,\sqrt 2 + \sqrt 3 = q-\sqrt 5 \in \Bbb Q(\sqrt 5) = \{ a + b\sqrt 5\ : a,b\in\Bbb Q\}\ $ so by induction $\,\sqrt 2,\sqrt 3\in \Bbb Q(\sqrt 5)\,$ so
$$\begin{align} \sqrt{2}\ =\ a_2 + b_2 \sqrt{5},\ \ \ a_2,b_2\in \Bbb Q\\ \sqrt{3}\ =\ a_3 + b_3 \sqrt{5},\ \ \ a_3,b_3\in \Bbb Q \end{align}$$
If $\,b_3 < 0\,$ then $\, a_3 = \sqrt 3 - b_3\sqrt 5 = \sqrt 3 +\! \sqrt{5b_3^2}\in \Bbb Q\,\Rightarrow\, \sqrt 3\in\Bbb Q\,$ by induction. Ditto if $\,b_2 < 0\,$
Else all $\,b_i \ge 0\,$ so $\,q = \sqrt 2\! +\! \sqrt 3\! +\! \sqrt 5 = a_2\!+\!a_3+(b_2\!+\!b_3\!+\!1)\sqrt 5\,\Rightarrow\,\sqrt 5 \in \Bbb Q\ $ by solving for $\,\sqrt 5,\,$ using $\,b_2\!+\!b_3\!+\!1 \neq 0\,$ by all $\,b_i\ge 0.\ $
Thus in every case some summand $\in \Bbb Q,\,$ which completes the proof.