Problem from Schikhof's Ultrametric Calculus.
As I understand it, the intersection of $\mathbf{R}$ and all $\mathbf{Q}_p$ is just $\mathbf{Q},$ so it seems that $x^2-a$ having a zero in $\mathbf{Q}$ implies that $\sqrt{a}\in\mathbf{R}$ and $\mathbf{Q}_p$ for all primes $p.$ And on the other hand, if $\sqrt{a}\in\mathbf{R}$ and $\mathbf{Q}_p$ for all $p,$ then in particular it is in their intersection, which implies $\sqrt{a}\in\mathbf{Q}.$
But this seems like such a trivial proof that I feel like I've misunderstood what is really going on, because it suggests a more general principle that a polynomial has a rational zero if and only if it has a real zero and a $p$-adic zero for any prime $p.$ In that case, why should the question have been specifically about squares?
Hoping someone can correct or verify what is going on here.
It doesn't make sense to consider the intersection of all of the $\mathbb Q_p$, since they are not all contained in some bigger field. In fact, the result is false in general! For example the polynomial $$3X^3+4X^3+5Y^3$$ has a root in $\mathbb R$ and $\mathbb Q_p$ for all $p$, but not in $\mathbb Q$.
In this case if $a$ is not a square in $\mathbb Q$, either $a$ is negative, in which case it has no solutions in $\mathbb R$, or without loss of generality, by replacing $X$ with $pX$ as necessary, we can assume that $a$ is square free. So $X^2-a$ is Eisenstein for any $p\mid a$.