In fact, all ways of picking a square root of each $a_i \bmod p$ in $\mathbf F_{p^2}$ that are consistent with all relations among the numbers $\sqrt{a_1},\ldots,\sqrt{a_n}$ arise from some choice of prime ideal $\mathfrak p$ where $(p) \subset \mathfrak p$: if $\alpha_i^2 = a_i$ in $\mathbf F_{p^2}$, then there.
There is a unique ring homomorphism
$$
\mathbf Z[x_1,\ldots,x_n]\to \mathbf F_{p^2}
$$$$
\mathbf Z[x_1,\ldots,x_n]\to \mathbf Z[\sqrt{a_1},\ldots,\sqrt{a_n}]
$$
where $x_i\mapsto \alpha_i$$x_i\mapsto \sqrt{a_i}$ for all $i$. This map killsLet $I$ be its kernel, an ideal, so we get an induced ring isomorphism
$$
\mathbf Z[x_1,\ldots,x_n]/I \to \mathbf Z[\sqrt{a_1},\ldots,\sqrt{a_n}].
$$
The ideal $I$ contains $x_i^2-a_i$ for all $i$, so $I$ contains $(x_1^2-a_1,\ldots,x_n^2-a_n)$, and $I$ could be bigger. Two examples: $\mathbf Z[\sqrt{2},\sqrt{3}] \cong \mathbf Z[x,y]/(x^2-2,y^2-3)$ and $\mathbf Z[\sqrt{2},\sqrt{8}] \cong \mathbf Z[x,y]/(x^2-2,y^2-8,2x-y)$.) The polynomials in $I$ are all polynomials in $x_1,\ldots,x_n$ that vanish when we getset $x_i = \sqrt{a_i}$ for all $i$, so $I$ tells us all the algebraic relations among $\sqrt{a_1},\ldots,\sqrt{a_n}$. A set of generators of $I$ is a set of relations among those square roots that explain all other relations among those square roots. In the ideal (ha-ha) situation that $a_1,\ldots,a_n$ are independent modulo squares, $I = (x_1^2-a_1,\ldots,x_n^2-a_n)$ by a counting argument whose details I omit.
Now let's try to work out what the ring homomorphisms
$\mathbf Z[\sqrt{a_1},\ldots,\sqrt{a_n}] \to \mathbf F_{p^2}$ are.
A subtlety is that we may not be able to send each $\sqrt{a_i}$ to either square root of $a_i \bmod p$ in $\mathbf F_{p^2}$ independently because relations among the numbers $\sqrt{a_i}$ might not be preserved among their images. As an inducedexample, say we're trying to build a ring homomorphism $\mathbf Z[\sqrt{2},\sqrt{8}] \to\mathbf F_{p^2}$. Since $\sqrt{8} = 2\sqrt{2}$, we have to make sure that the square roots of $2$ and $8$ that we use as target values in $\mathbf F_{p^2}$ have the same relation "$\beta = 2\alpha$". Being careless about which square roots we use $\mathbf F_{p^2}$ might not have this relation hold (perhaps $\beta = -2\alpha$).
This is why it is convenient to use the ring isomorphism
$$
\mathbf Z[x_1,\ldots,x_n]/(x_1^2-a_1,\ldots,x_n^2-a_n)\to \mathbf F_{p^2},
$$$$
\mathbf Z[x_1,\ldots,x_n]/I \to \mathbf Z[\sqrt{a_1},\ldots,\sqrt{a_n}].
$$
andThe ring homomorphisms $\mathbf Z[\sqrt{a_1},\ldots,\sqrt{a_n}] \to \mathbf F_{p^2}$ can be viewed as the domainring homomorphisms $\mathbf Z[x_1,\ldots,x_n]/I \to \mathbf F_{p^2}$, which are the same thing as the ring homomorphisms $\varphi : \mathbf Z[x_1,\ldots,x_n] \to \mathbf F_{p^2}$ that are $0$ on $I$. Every ideal in $\mathbf Z[x_1,\ldots,x_n]$ is isomorphic tofinitely generated, and when $\mathbf Z[\sqrt{a_1},\ldots,\sqrt{a_n}]$ by identifying$I = (f_1,\ldots,f_r)$, having $\varphi = 0$ on all of $I$ is the cosetsame thing as having $\varphi(f_j) = 0$ for $j = 1,\ldots,r$.
Using generators of the ideal $x_i$ with$I$, we can say exactly which choices of square roots of $a_i$ in the finite field $\mathbf F_{p^2}$ occur as images of $\sqrt{a_i}$.
Theorem. Let $I = (f_1,\ldots,f_r)$. Then for choices of $\alpha_i \in \mathbf F_{p^2}$ such that $\alpha_i^2 = a_i$, there is a ring homomorphism
$\mathbf Z[\sqrt{a_1},\ldots,\sqrt{a_n}] \to \mathbf F_{p^2}$ such that $\sqrt{a_i} \mapsto \alpha_i$ if and only if $f_j(\alpha_i,\ldots,\alpha_n) = 0$ in $\mathbf F_{p^2}$ for $j=1,\ldots,r$.
Example. When $a_1,\ldots,a_n$ are independent modulo squares,
so $I = (x_1^2-a_1,\ldots,x_n^2-a_n)$, every choice of $\alpha_i$ in $\mathbf F_{p^2}$ such that $\alpha_i^2 = a_i$ can be used to define a ring homomorphism
$\mathbf Z[\sqrt{a_1},\ldots,\sqrt{a_n}] \to \mathbf F_{p^2}$.
Example. We have $\mathbf Z[\sqrt{2},\sqrt{8}]\cong \mathbf Z[x,y]/(x^2-2,y^2-8,2x-y)$, so we get a choice of (unique)$\alpha$ and $\beta$ in $\mathbf F_{p^2}$ such that $\alpha^2 = 2$ and $\beta^2 = 8$ can be used to define a ring homomorphism
$\mathbf Z[\sqrt{2},\sqrt{8}] \to \mathbf F_{p^2}$ if and only if $2\alpha = \beta$.
In the general case, once we have a ring homomorphism
$$
\mathbf Z[\sqrt{a_1},\ldots,\sqrt{a_n}]\to \mathbf F_{p^2}
$$
where $\sqrt{a_i} \mapsto \alpha_i$ for all $i$. The, its kernel has to be a nonzero prime ideal, say $\mathfrak p$, so we get an induced ring embedding
$$
\mathbf Z[\sqrt{a_1},\ldots,\sqrt{a_n}]/\mathfrak p \hookrightarrow \mathbf F_{p^2}
$$
with image $\mathbf F_p$ or $\mathbf F_{p^2}$ in which $\sqrt{a_i} \bmod \mathfrak p = \alpha_i$$\sqrt{a_i} \bmod \mathfrak p$ is mapped to $\alpha_i$ for all $i$. This does not just preserve additive relations among all $\sqrt{a_i}$ when going from characteristic zero to characteristic $p$, but all multiplicative relations as well (it is a ring homomorphism).