Following are examples of 3.0.1 in Hartshorne's textbook
If $X=\operatorname{Spec}A $ is an affine scheme, then
i) $X$ is reduced if and only if $\operatorname{Nil}A=0$
$(\Rightarrow)$ for every open in $U$ in X, $\mathcal{O}_X(U) $ has no nilpotent. Thus, take by $U=X$, $\mathcal{O}_X(X)=A$. Thus, $\operatorname{Nil}A=0$. The trouble is $(\Leftarrow)$. At the outset, I attampted to use contravariance propery of sheaf. since $U \subset X$, (for any open in $U$), $\mathcal{O}_X(U) \supset \mathcal{O}_X(X)=A $ , I expect to hold $\operatorname{Nil}\mathcal{O}_X(U) \subset \operatorname{Nil}\mathcal{O}_X(X)=\operatorname{Nil} A = 0 $...(★). However, (★) does not hold.
ii) $X$ is integral if and only if $A$ is an integral domain. : Also this has similar trouble .. $(\Rightarrow)$ is obvious by taking $U=X$, $\mathcal{O}_X(X)=A$ is an integral domain. But, $(\Leftarrow)$ is not easy for me.
The first idea is to show that if $A$ is reduced (resp. integral), then all its localizations are reduced (resp. integral). This shows $\Leftarrow$ for affine open subsets.
In the reduced case, $\Leftarrow$ follows formally from the statement for affine open subsets.
In the integral case, if $A$ is integral, then all restriction maps $\mathcal{O}_X(U) \rightarrow \mathcal{O}_X(V)$ are injective – start when $U$ is affine and $V$ principal in $U$, then extend to the case $U$ affine and any $V \subset U$, and finally show it for general $U$ and any $V \subset U$. The conclusion (of $\Leftarrow$) follows since the ring of global sections over any principal open subset of $X$ is integral.