smooth connected affine scheme over Z has good reduction almost everywhere Let $f(x_1,\ldots,x_n)\in\mathbf{Z}[x_1,\ldots,x_n]$ be a polynomial. Assume that the variety cut out by $f$ is smooth and connected (so irreducible) over $\overline{\mathbf{Q}}$. Where can I find a proof of the following classical result: for almost all primes $p$, $f\pmod{p}$ is a smooth $\mathbb{F}_p$-scheme.   
added
Let me rephrase the problem a bit differently. 
Let us denote the zero locus in a field $k$ of a family of polynomials $\mathcal{F}$ with $\mathbf{Z}$-coefficients by $Z(\mathcal{F};k)$.
Let $\nabla(f)=(g_1,g_2,\ldots,g_n)$.
So assume that 
$$
Z(g_1,g_2,\ldots,g_n,f;\overline{\mathbf{Q}})=\emptyset
$$
How do you prove that for almost all primes $p$
$$
Z(g_1,g_2,\ldots,g_n,f;\overline{\mathbf{F}_p})=\emptyset  ?
$$
 A: I will first respond to the added question and then, for the sake of (likely unnecessary) completeness, give a few more details for the sort of argument that Ari proposed.
Let $g_1,\dotsc,g_r,f$ be elements of $S = \mathbf{Z}[x_1,\dotsc,x_n]$. In the rephrased question, one assumes $Z(g_1,\dotsc,g_r,f;\overline{\mathbf{Q}})=\emptyset$. By the Nullstellensatz, one then knows that $g_1,\dotsc,g_r,f$ generate the unit ideal in $S\otimes_\mathbf{Z}\mathbf{Q}$, i.e. that there is a relation
$$
a_1 g_1 + \dotsb + a_r g_r + b f = 1,
$$
where $a_1,\dotsc,a_r,b\in S\otimes_\mathbf{Z} \mathbf{Q}$. The polynomials $a_1,\dotsc,a_r,b$ have a common denominator $N$, and so they belong to $S\otimes_{\mathbf{Z}}\otimes{\mathbf{Z}[1/N]}$, and the above equation holds in this ring as well. It thus holds in all quotients of this ring, and thus for $p$ prime to $N$, there are no solutions in $\overline{F_p}$.

Perhaps it is also worth making something like Ari's argument even more explicit and concrete to make clear the role $\nabla$ in Hugo's addition. Consider first a more general setting of an ideal $I$ in $S = R[x_1,\dotsc,x_n]$. Let $A = S/I$. The scheme morphism ${\rm Spec}(A)\to {\rm Spec}(R)$ is smooth precisely when the usual map $I/I^2\to \Omega^1_{S/R}\otimes_S A$ defined by $f\mapsto df\otimes 1$ is a split injection: the nilsquare lifting property for ${\rm Spec}(A)\to {\rm Spec}(R)$ is a direct consequence of the existence of a splitting and of the smoothness of ${\rm Spec}(S)\to{\rm Spec}(R)$.
(I will spell this ``direct consequence'' out: to see the nilsquare lifting property in general, by the smoothness of $S/R$ (for which the lifting property is trivial), it is enough to consider the problem of lifting the identity map $A\to A$ along $S/I^2\to A$. We have the quotient map $S\to S/I^2$, and the splitting $s$ in question tells us exactly how to modify the quotient map so that it vanishes on $I$ and thus factors through $A$; indeed, the map $f\mapsto \overline{f} - s(df\otimes 1)$ is another homomorphism $S\to S/I^2$ lifting $S\to A$, and it vanishes on $I$ by definition. Conversely, if we know that $A/R$ is smooth, then reversing these steps and applying the nilsquare lifting property to lift the identity map $A\to A$ along $S/I^2\to A$ provides us with a splitting.)
Turning to the case in question, we take first $R = \mathbf{Q}$ and $I = (f)$. The $A$-module $I/I^2$ is free of rank $1$ with generator $f$. By the smoothness assumption (which we may make over $\mathbf{Q}$ just as well as over $\overline{\mathbf{Q}}$ without changing the problem), there is a splitting $s:\Omega^1_{S/R}\otimes_S A\to I/I^2$. Let $a_i f = s(dx_i\otimes 1)$. Since the image of the generator $f$ of $I/I^2$ in $\Omega^1_{S/R}\otimes_S A$ is $\sum_i (\partial f/\partial x_i) (dx_i\otimes 1)$, we have
$$
\sum_i \frac{\partial f}{\partial x_i} a_i = 1,
$$
i.e. the $\partial f/\partial x_i$ generate the unit ideal in $A$. Conversely, if the $\partial f/\partial x_i$ generate the unit ideal and we have such $a_i$, we can construct a splitting $dx_i\mapsto a_i$. Thus smoothness for $I=(f)$ is equivalent to the fact that the $\partial f/\partial x_i$ generate the unit ideal in $A$.
Now we can see how smoothness spreads out from the generic fiber: the $a_i$ all belong to the subring $\mathbf{Z}[1/N][x_1,\dotsc,x_n]/(f)$ of $A$ for some $N$. The $\partial f/\partial x_i$ thus generate the unit ideal in $\mathbf{Z}[1/N][x_1,\dotsc,x_n]/(f)$, which allows us to construct the splitting and hence to get smoothness of $\mathbf{Z}[1/N][x_1,\dotsc,x_n]/(f)$ over $\mathbf{Z}[1/N]$. Reducing mod $p$, we get smoothness over $\mathbf{F}_p$ whenever $p$ is prime to $N$.
A: Let $f:X\to \operatorname{Spec}\mathbb Z[1/n]$ be a morphism of finite type. As $f$ is generically flat, there is a finite set of primes $S$ such that $X\to  \operatorname{Spec} \mathbb Z$ is flat over $\operatorname{Spec}\mathbb Z - S$. (This is easy to show, so let's assume $f$ is flat now.)
If $f$ is flat along the generic point, and its generic fiber is smooth, then it is smooth along the preimages of the generic point by a classical result. We can find an affine open neighborhood of each preimage of the generic point such that the restriction of $f$ to each affine open is smooth. Since $f$ is quasi-compact there are finitely many of these, call them $U_1,\ldots,U_n$. Taking the intersection $V = \cap_{i=1}^n f(U_i)$, we have an open set of $\operatorname{Spec}\mathbb{Z}$ for which the induced map $f: f^{-1}(V) \to V$ is smooth. The topology on $\operatorname{Spec}\mathbb{Z}$ is such that non-empty opens are the complement of finitely many primes, so there is a finite set of primes $S$ such that $X\to \operatorname{Spec}\mathbb Z[1/n]$ is smooth over $\operatorname{Spec}\mathbb Z - S$.
In general you can't weaken finite type to locally of finite type here.
To prove this, you can proceed in many ways.  One way is to use the sheaf of differentials. That sheaf is locally free [Edit: of rank $\dim X_{\mathbb{Q}}$] if and only if the morphism is smooth.
A: This is just an after thought about my question. At the end it is really a linear algebra problem. Starting with the polynomials $g_1,g_2,\ldots,g_n,g_{n+1}=f$ one may ask if it is possible to find an array of coefficients 
$$
a_{\underline{i}}^{(k)}
$$ 
where $\underline{i}=(i_1,i_2,\ldots,i_n)$ are $n$-tuples and $1\leq k\leq n+1$ such that
$$
\sum_{k=1}^{n+1}\left(\sum_{\underline{i}} a_{\underline{i}}^{(k)}x_1^{i_1}\ldots x_{n}^{i_n}\right)g_k=cte
$$ 
Now thanks to the Nullstellensatz, since
$Z(g_1,g_2,\ldots,g_n,g_{n+1};\overline{\mathbf{Q}})=\emptyset$, we know that this linear algebra problem adimts a solution (even over $\mathbb{Q}$ since the system is linear). So really, what the Nullstellensatz says is that unless there is some commun solution to your set of polynomials in an algebraic closure, then the set of linear equations above always admit a solution.  
