Suppose I have some $f\in \mathbb{Z}[x]$ and some $a\in \mathbb{Z}$ such that $f(a)\equiv 0 \mod p$ for all primes $p$. Then of course $f(a)=0$. Suppose now I have a scheme $X$ over $\mathbb{Z}$ and for each prime $p$ I have a point $a_p\in X(\mathbb{F}_p)$ all of which define the same topological point $P\in X^{\text{top}}$. Under which conditions can I then conclude the existence of a point $a\in X(\mathbb{Q})$ also defining the same topological point $P$?
Intuitively the answer seems to be yes, but I know that the problem of determining the existence of rational points on some scheme is very difficult. Is thinking about $K$-rational points as "solutions to equations in $K$" even the correct intuition?