If $X=Spec(A)$, we have $X_ \text {red}=Spec(A_\text {red})$, where $A_{\text {red}}=A/\text{Nil(A)}$ so that:
$\Gamma(X,\mathcal O_X)=A$
but
$\Gamma(X_{\text {red}},\mathcal O_{X_ \text {red}})=A_{\text {red}}=A/\text{Nil(A)}$
No contradiction with Hartshorne's 2.2.2.(c)!
Edit: some details
Here are some statements which might help shed light on this subtle question.
a) Given a scheme $X$ we associate to it the quasi-coherent sheaf of ideal $\mathcal N\subset \mathcal O_X$ defined for an arbitrary open subset $U\subset X$ by $$\mathcal N(U)=\{f\in \mathcal O_X(U)\mid \forall x\in \mathcal O_{X,x },\; f_x \in \text {Nil}(\mathcal O_{X,x }) \}$$ b) The scheme $X_{\text {red}}$ has structure sheaf $\mathcal O_{X_{\text {red}}}=\mathcal O_X/\mathcal N$
c) For any affine subset $U=\text {Spec} (A)\subset X$, we have $ \text {Nil}(\Gamma(U,\mathcal O_X))=\mathcal N(U)=\text {Nil}(A)$
d) For any affine subset $U=\text {Spec} (A)\subset X$, we have $\mathcal O_{X_{\text {red}}}(U)=A_{\text {red}}=A/{\text {Nil}} (A)$
e) For a general open subset $U\subset X$ , we have $ \text {Nil}(\Gamma(U,\mathcal O_X))\subset \mathcal N(U)$
but the inclusion may be strict for non-affine $U$:
Let $X_m=\text {Spec}(\mathbb C[T]/T^m)=\text {Spec}(\mathbb C[\epsilon _m])$ and $X=\bigsqcup X_m$ (a non-affine scheme).
Then $\Gamma(X,\mathcal O_X)=\prod \Gamma(X_m,\mathcal O_{X_m})=\prod \mathbb C[\epsilon _m]$ and for $\epsilon=(\epsilon_1,\epsilon_2,\cdots)$ we have $\epsilon \notin \text {Nil}(\Gamma(X,\mathcal O_X))$ although $\epsilon \in \mathcal N(X)$.
As Stahl says it suffices to have some non reduced scheme $X$ with global sections ring $\mathcal{O}_X(X)$ non reduce. The example given here is perfect: $X=\operatorname{Proj}k[s,x_0,x_1]/(s^2)$ is not reduce because with
$$U=D_+(x_0)=\operatorname{Spec}\left(k\left(\frac{s}{x_0},\frac{x_1}{x_0}\right)/\left(\left(\frac{s}{x_0}\right)^2\right)\right)$$
one has $\mathcal{O}_X(U)$ not reduced but the global sections ring $\mathcal{O}_X(X)$ is reduced because
$$\mathcal{O}_X(X)=k$$
se the link above.
Best Answer
Hint:
Can you construct a ''fat'' projective line of some sort? Namely, remember that $\text{Spec } k[x]$ is the affine line and we get projective space by gluing together two affine lines. Can you do something similar by fattening up the lines you glue?
My example was the following. Take $\text{Proj } k[x,y,z]/z^2$. I believe that working on affines, this should produce something with only $k$ as global sections. I haven't worked it out in detail however.