This question is called "Hasse / local-global principle" and there is a large literature on its truth and falsity in various situations. For example, re Goucher's 4 squares example, relevant is "Hasse's theorem": Consider F(x1,x2,...,xm)=0 with F a homogeneous quadratic polynomial. This has a solution over Z^m iff it has a solution over Q^m, iff it both has a solution mod N for every N>1 and has a real-number solution, iff it both has a solution mod P^K for every K>0 and prime P and has a real-number solution. However, the Hasse principle fails for homogeneous cubics. Example by Selmer 3*X^3 + 4*Y^3 + 5*Z^3 = 0 has no nontrivial integer solutions despite having both real solutions and solutions modulo N for every N>1. -- Warren D. Smith http://RangeVoting.org <-- add your endorsement (by clicking "endorse" as 1st step)