If a function vanishes at all points of a quasicompact scheme, then some power of it is zero 
Let's fix a finite cover of $X$ by $\operatorname{Spec}(A_i)$ for various $A_i$s.
A "function" is an element of $\mathcal O_X(U)$ for some open $U$ (if I understand the definition on p.136 of Vakil's FOAG (where this exercise is from) correctly). In general, "an element $f\in R$  vanishes at $P\in \operatorname{Spec}(R)$"
means that $f\in P$. In our case, $f$ vanishes at all points of $X$ -- does it mean that it vanishes at all prime ideals of $\operatorname{Spec}(A_i)$ for all $i$? Then $f$ must lie in each $A_i$, right? But we only know that $f$ lies in $\mathcal O_X(U)$ for some open $U$. So I must be misunderstanding what's going on here.
Then I need to find $n$ such that $f^n=0$ in the ring $\mathscr O_X(U)$. But this is just an abstract ring from the definition of a sheaf, how to get hold of that $n$ without knowing anything about this ring?
I also tried to approach this exercise from a different side (by understanding the suggested counterexample), but I don't understand it either.
 A: Saying that $f$ vanishes at all points of $X$ means that $f\in\mathcal{O}_X(X)$ and for every $x\in X$, the image of $f$ under the composite homomorphism $$\mathcal{O}_X(X)\to \mathcal{O}_{X,x} \to \kappa(x)$$ is zero.
To actually solve the problem, cover $X$ by finitely many affine opens $\operatorname{Spec} A_i$ and let $f_i$ denote the image of $f$ in $A_i$ under the restriction mapping $\mathcal{O}_X\to\mathcal{O}_X(\operatorname{Spec} A_i)=A_i$. Then if we can show that there's some $n$ so that $f_i^n=0$ for all $i$, we'll know that $f^n=0$ by the sheaf condition.
Let's investigate the condition that $f$ vanishes at all points and how that affects the $f_i$. Since $f_i$ vanishes at all points of $\operatorname{Spec} A_i$ (because it's the restriction of $f$ which vanishes at all points of $X$), we have that $f_i$ belongs to every prime ideal in $A_i$, as you've noted. But the intersection of all prime ideals of a ring is exactly the nilradical, and therefore $f_i^{m_i}=0$ for some $m_i$.
Since we have finitely many affine opens, we can set $n=\max_i m_i$ and then $f^n=0$, and this finishes the problem as we claimed above.

The finiteness of the cover was key. If we don't have a finite cover, it could be the case that as we go through the cover, we keep finding that we need bigger and bigger $m_i$ so that there's no $n$ which works. This is the point of the counterexample: the global section of $\coprod_{m\in\Bbb N} \operatorname{Spec} k[\varepsilon]/\varepsilon^m$ which is $(\varepsilon,\varepsilon,\cdots)$ has no single $n$ which works: if you pick any prospective $n$, just got to $\operatorname{Spec} k[\varepsilon]/\varepsilon^{n+1}$ and see that the $n^{th}$ power of our global section is not zero in that ring.
