Equality of functions in a reduced scheme

abstract-algebraalgebraic-geometrycommutative-algebra

Suppose $X$ is a reduced scheme and $f$ and $g$ agree at every point of $X$. Why is it true that $f=g$?

For simplicity, if we fist assume that $X$ is affine, say $X=\operatorname{Spec}A$, then $f$ and $g$ agreeing at every point of $X$ means that $f + P=g + P$ for every $P\in X$ and so $f-g\in P$ for every $P\in X$. I am not sure where to go from here.

For context this appears at the end of problem 5.2.A in Vakil's algebraic geometry notes: "Show that a scheme is reduced if and only if none of the stalks have nonzero nilpotents. Hence show that if $f$ and $g$ are two global sections that agree at all points, then $f=g$. "

I've proven the first statement. The hint for the second statement is that the "nilradical is the intersection of all prime ideals." How do I use this hint?

Best Answer

Well, $f-g\in P$ for all $P$ means $f-g$ is in the intersection of all of the primes, i.e. the nilradical, which by assumption is zero.