# Closed points are dense in $\operatorname{Spec} A$

From 3.6.J in Vakil:

Let $k$ be a field, and let $A$ be a finitely generated $k$-algebra. We want to show the closed points are dense in $\operatorname{Spec} A$. This is the set of prime ideals of $A$ endowed with the Zariski topology; closed points correspond to maximal ideals. Using distinguished open sets, this exercise amounts to showing that any distinguished open set $D(f) \neq \operatorname{Spec} A$ contains a closed point; i.e. we want a maximal ideal of $A$ not containing $f$.

Vakil then gives a hint about using the nullstellensatz and residue fields, but I don't see why we can't just do the following: there's an inclusion-preserving bijection between (i) ideals of $A$ not containing any power of $f$, and (ii) ideals of the localization $A_f$. Then take a maximal ideal of $A_f$; which gives a maximal ideal of $A$ not containing $f$.

Is this right? It seems too simple given the hint, so I think I'm botching something.

You're right that a maximal ideal of $A_f$ corresponds to an ideal in $A$ not containing any power of $f$, but this ideal need not be maximal in $A$.
A distinguished open set $D(f)$ is nonempty if and only if $f$ is not nilpotent (since the nilradical is the intersection of all prime ideals). Showing that the closed points are dense amounts to showing that if $f$ is not nilpotent, then there is some maximal ideal which does not contain it. Turning this around, the closed points are dense if and only if the Jacobson radical (the intersection of all maximal ideals) equals the nilradical (the intersection of all prime ideals). This is not true in general, e.g. take any DVR.