Dear John,
What James is alluding to at the end of his post is that if you don’t try to define
the Hasse–Weil zeta-function for varieties over $\mathbf Q$, but instead think of it as a notion for varieties over
$\mathbf Z$, then the local factors are given by point counting: namely you form the zeta-function of the fibre
$X_p$ for each prime $p$ — which is a point-counting thing , then replace the variable $T$ in the
zeta-function by $p^{-s}$ (if you use the form of the zeta-function for varieties in char. $p$ which has a
variable $T$; if you use the definition which already
has $p^{-s}$ in it, then leave it alone!), then multiply all of these together.
This is not the conventional way that things are done, though. Typically, one has a variety over $\mathbf Q$ (or more generally an algebraic number field, but let me stick
to the case of $\mathbf Q$),
and wants to define its Hasse–Weil zeta-function. Ideally, one would want to define some sort of “minimal model” of $X$ over $\mathbf Z$, and then apply the formalism of the preceding paragraph. But the theory of bad reduction of varieties over number fields is not well-understood (what one would like would be “semi-stable reduction”-type theorems, which are closely related to the problem of resolution of singularities. In positive char., one doesn’t yet have a general analogue of Hironaka’s theorem on resolution of singularities, and the situation in mixed characteristic (i.e. for varieties over $\mathbf Z$) is just as bad, if not worse).
So, rather than using concrete geometry at bad primes, and then point counting, one uses the crutch of etale cohomology. (This is a frequently used crutch — often there is concrete geometry that one would like, but which is unknown, but the cohomological avatar of the geometry is somewhat better understood; think of the Hodge conjecture, say. As always seems to be the case, though, a price is paid for taking this short-cut: you’ll see below that I have to invoke various conjectures for everything to make sense in the end.)
The recipe is as follows: one takes the $\ell$-adic cohomology of $X$ for some prime $\ell$ (conjecturally, it shouldn’t matter which one, although I don’t think this is known in general — another failure of our concrete geometric knowledge, and another sign that we are using a crutch!). This gives a finite-dimensional $\mathbf Q_{\ell}$-vector space with an action of the Galois group of
$\overline{\mathbf Q}$ over $\mathbf Q$. Its dimension is just the same as the usual (singular, say) cohomology of $X$
over the complex numbers with $\mathbf Q$ (or $\mathbf R$,
or $\mathbf C$) coefficients.
For each prime $p$, and each degree $i$ of cohomology, we take the invariants under $I_p$ (the inertia group at $p$); this will be the whole thing if $p$ is a prime of good reduction, but can be (and often is) smaller otherwise.
On this space we have an action of the Frobenius $Frob_p$.
We take the char. poly. of $Frob_p^{-1}$ (the exponent $-1$ appears for technical reasons, to make everything work out well when you compare with the point-counting picture at good reduction primes), call this $P_{i,p}(T)$. (Remember
that $i$ is the degree of cohomology.)
The $\zeta$-function is then defined to be
$\prod_{p,i}P_{i,p}(p^{-s})^{(-1)^i}.$
It might help to break the product up into two products:
$\prod_{p} \prod_i P_i(p^{-s})^{(-1)^i}.$
The inner product is finite(it just runs over $i = 0$
to $2 dim(X)$), and its gives the Euler factor for each
prime $p$. The outer product is now over all primes,
and is the Euler product for the $\zeta$-function of $X$.
(There are more conjectures that need to hold to make
sure this makes sense, since a priori the coefficients
of the $P_{i,p}$ are $\ell$-adic numbers, but we are
plugging in the complex number $p^{-s}$! What happens
is that at the good reduction primes, by using the Lefschetz fixed point formula, one finds that the Euler factors at good reduction primes are just given by point counting, and in particular have integral coefficients rather then just $\ell$-adic ones, so it is okay to
plug in $p^{-s}$. This is conjectured to be true at bad primes too, but is not know in general, I think. It is related to the independence-of-$\ell$ conjecture I mentioned above.)
Finally, the Dedekind $\zeta$-function corresponds to the case $X$ is a point, which has good reduction everywhere (!),
which is why one doesn’t need to tell this story.
One last (even more) technical remark, related to the preceding paragraph:
if one replaces $\mathbf Q$ by a number field $K$, there are two ways to proceed.
(1) One can just work over $K$, and replace the rational primes $p$ considered above by primes $q$ of $K$.
(2) One can apply restriction of scalars to think of $X$ over $K$ as
a variety $X'$ over $\mathbf Q$. (Restriction of scalars, which sometimes goes
under the even lengthier name of “Weil restriction of scalars” is just algebraic-geometry speak for the process via which you can think of a complex manifold as also being a real manifold of twice the dimension.) One can then apply the above story to $X'$.
It turns out that processes (1) and (2) give the same answer. When you were collecting your terms in the Dedekind $\zeta$-function of $K$ for all the
$q$ of $K$ dividing a given rational $p$, you were implicitly moving from point-of-view (1) to point-of-view (2).
Now if we take a point over $K$, and take point-of-view (2), we get a variety
over $\mathbf Q$ which is a finite union of points ($[K:\mathbf Q]$ many), which are however not defined over $\mathbf Q$. Concretely, if $K = \mathbf Q(\alpha)$ and
$f(X)$ is the minimal polynomial of $\alpha$ over $\mathbf Q$, then $X'$
is the variety $f(X) = 0$.
Now $X'$ won’t have good reduction everywhere; it has bad reduction at primes
$p$ that are ramified (concretely, because at these primes, not matter what $\alpha$
you choose, some roots of the corresponding $f$ will come together mod $p$).
So the above story does apply! (But of course, in the zero-dimensional case one
doesn’t need to use all the cohomological machinery.)
How do you see this concretely? Well, at the ramified $p$, the Euler factor of
the zeta-function of $K$ has smaller degree (i.e. degree less than $[K:\mathbf Q]$) than at the unramified primes.
Re: Zeta Functions: Dedekind Versus Hasse-Weil
I think the standard definition of the Euler factor at $p$ is that you take the characteristic polynomial of Frobenius at $p$ on the inertia-invariant subspace of the $\ell$-adic cohomology of the variety. Here’s a bit of explanation. The $\ell$-adic cohomology naturally comes with a linear action of the absolute Galois group, and the inertia subgroup means the inertia subgroup for any prime over $p$ (it doesn’t matter which), so when you take invariants, you get a well-defined Frobenius endomorphism. Also by ‘characteristic polynomial’, I mean in the graded sense, so you actually get a ratio of two polynomials.
It’s then an exercise to show that the Hasse-Weil zeta function agrees with the Dedekind zeta function. The key thing to know is that if $K$ is a finite Galois extension of $\mathbf{Q}$, then the $\ell$-adic cohomology of $\mathrm{Spec}(K)$ is trivial in positive degrees and is just the regular representation of $\mathrm{Gal}(K/\mathbf{Q})$ in degree zero. Then you need a bit of basic algebraic number theory and representation theory of finite groups. (NB I didn’t check it when $K$ is not Galois over $\mathbf{Q}$. It’s probably true and the proof is probably essentially the same.)
There are actually some problems with the Hasse-Weil zeta function at bad primes. For instance the zeta function of a product of varieties (over $\mathbf{Q}$) is not determined by the zeta functions of their factors. For disjoint unions, it’s OK. Probably, the right way to solve this is by working with varieties $X$ over $\mathbf{Z}$, rather than varieties over $\mathbf{Q}$. Then the good definition of the zeta function would just be the Euler product of the local zeta functions of the mod $p$ reductions $X_p$ (aka ‘fibers over $p$’) of $X$. For a bit more on this, see this.
With this definition, you can even forget about etale cohomology. In fact, you don’t even really have to know what a variety $X$ over $\mathbf{Z}$ means, because all you’re using is the fibers $X_p$. (But if you pick a random family of varieties $X_p$, each defined over $\mathbf{Z}/p\mathbf{Z}$, then it will almost never come from a variety over $\mathbf{Z}$. And in that case, the zeta function you get won’t have any good properties, because the fibers might not have anything to do with each other. But as long the varieties $X_p$ look like they’re all mod $p$ reductions of a single variety, you’ll probably be OK.)