For a commutative and unitary ring $R$ and an ideal $I$ of $R$, suppose that $\mathrm{Id}(I)$ is the ideal of $R$ generated by idempotent elements of $I$. It is well-known that $\mathrm{Nil}(R)=\bigcap_{P\in \mathrm{Spec}(R)} P$ is the set of all nilpotent elements of $R$, and if $e^2=e\in \mathrm{Nil}(R)$, then $e$ must be zero element. Now I want to know if the following is true:
$$\bigcap_{P\in \mathrm{Spec}(R)} \mathrm{Id}(P)=\{0\}.$$
Yes, this is true. Note that if $f\in\mathrm{Id}(P)$, then there exists an idempotent $e\in P$ such that $ef=f$ (since an ideal generated by finitely many idempotents is generated by a single idempotent). The vanishing set of $e$ is then a clopen subset $U\subseteq\operatorname{Spec} R$ such that the restriction of $f$ to $U$ is $0$. So if $f\in\mathrm{Id}(P)$ for all $P$, every point of $\operatorname{Spec} R$ has an open neighborhood on which $f$ restricts to $0$. Since $\mathcal{O}_{\operatorname{Spec} R}$ is a sheaf, this implies $f=0$ as a global section of $\mathcal{O}_{\operatorname{Spec} R}$, i.e., as an element of $R$.
Or if you prefer to state it in algebraic language, the annihilator of $f$ cannot be contained in any prime ideal, since for any $P$ the argument above gives an idempotent $1-e\not\in P$ that annihilates $f$. So the annihilator of $f$ must be all of $R$, and hence $f=0$.