Exercise I-25 of Eisenbud and Harris' "Geometry of Schemes" defines the following scheme, which is then claimed to be the smallest non-affine scheme:
Let $X=\{p,q_1,q_2\}$ with the open subsets $\emptyset,\{p\},\{p,q_1\},\{p,q_2\},X$ and define a sheaf $\mathcal O$ of rings on $X$ as $\mathcal O(\{p\})=k(x)$, $\mathcal O(\{p,q_1\})=\mathcal O(\{p,q_2\})=\mathcal O(X)=k[x]_{(x)}$ with the obvious restriction maps.
Now I have been struggling for hours to prove that this is not an affine scheme. I can derive several properties of the ring whose spectrum would be isomorphic to $(X,\mathcal O)$ as a locally ringed space, but so far I haven't found any contradictions. How can I prove this scheme is not affine? Could somebody provide a hint to point me in the right direction?
Hint: an affine scheme $X$ is always isomorphic to Spec $\mathcal O (X)$