The second half of this answer is based on @RobertIsrael's comment here.
Let $\mathbf{q} = (q_1,\dots,q_n) \in \mathbb{Q}^n$. For every $t \in \mathbb{R}$, we have that
$$
(q_1 \pm t, \dots, q_n \pm t) \in \mathbb{P}^n \cup \mathbb{Q}^n
$$
for every choice of sign in each coordinate. This is because if $t \in \mathbb{Q}$, then the above element lies in $\mathbb{Q}^n$ and if $t \in \mathbb{P}$ then the above element lies in $\mathbb{P^n}$. Any two elements in $\mathbb{Q}^n$ can be connected by means of such straight-line paths. Hence, $\mathbb{Q}^n$ is contained in a path-connected component.
Next, let $\mathbf{r} = (r_1,\dots,r_n) \in \mathbb{P}^n$. There is a sequence $\mathbf{q}_j = (q_{1j},\dots,q_{nj}) \in \mathbb{Q}^n$ such that $\lim_{j \to \infty} \mathbf{q}_j = \mathbf{r}$, that is, $\lim_{j \to \infty} q_{ij} = r_i$ for each $1 \leq i \leq n$. By the previous discussion, there is a path in $\mathbb{P^n} \cup \mathbb{Q}^n$ connecting $\mathbf{q}_j$ to $\mathbf{q}_{j+1}$ for each $j \in \mathbb{N}$. By concatenating these paths, we get a path in $\mathbb{P}^n \cup \mathbb{Q}^n$ connecting $\mathbf{q}_1 \in \mathbb{Q}^n$ with $\mathbf{r} \in \mathbb{P}^n$. This shows that $\mathbb{P}^n$ is contained in the same path-connected component as $\mathbb{Q}^n$.
Thus, $\mathbb{P}^n \cup \mathbb{Q}^n$ is path-connected.