I just read something in Eisenbud and Harris' The Geometry of Schemes that I am having trouble believing. I must be missing something. Can you help me figure out what?
Let $(X,\mathscr{O})$ be a ringed topological space. Let $R = \mathscr{O}(X)$. For given $f\in R$, let $U_f$ be the set of points $x$ of $X$ such that $f$ is a unit in $\mathscr{O}_x$. Eisenbud and Harris say $(X,\mathscr{O})$ is affine if:
(i) $\mathscr{O}(U_f) = R_f$.
(ii) $\mathscr{O}_x$ is a local ring for all $x\in X$.
(iii) The natural map of topological spaces $X\rightarrow\operatorname{Spec} R$ given by mapping $x$ to the pullback in $R=\mathscr{O}(X)$ of the maximal ideal of $\mathscr{O}_x$ is a homeomorphism.
(This is on pp. 21-22.)
Then, Exercise I-24(a) reads:
Take $Z=\operatorname{Spec}\mathbb{C}[x]$, let $X$ be the result of identifying the two closed points $(x)$ and $(x-1)$ of $|Z|$, and let $\varphi:Z\rightarrow X$ be the natural projection. Let $\mathscr{O}$ be $\varphi_*\mathscr{O}_Z$, a sheaf of rings on $X$. Show that $(X,\mathscr{O})$ satisfies condition (i) above for all elements $f\in \mathscr{O}(X) = \mathbb{C}[x]$, but does not satisfy condition (ii).
I don't see that $(X,\mathscr{O})$ satisfies condition (i) either. It seems to me that if $p^\star\in X$ is the image of the two identified closed points, then $\mathscr{O}_{p^\star}$ is the ring obtained by localizing $\mathbb{C}[x]$ at the complement of the union $(x)\cup (x-1)$. (This is the failure of (ii) because this ring has two maximal ideals.) Then let $f$ be any function in one but not the other of $(x),(x-1)$; $f=x$ for example. The set $U_f$ of $p\in X$ such that $f$ is a unit in $\mathscr{O}_p$ does not include $p^\star$. In the case $f=x$ it is precisely the complement of $p^\star$. Then
$$\mathscr{O}(U_f) = \mathscr{O}_Z(\operatorname{Spec}\mathbb{C}[x]\setminus \{(x),(x-1)\})= \mathbb{C}[x]_{x(x-1)} \neq \mathbb{C}[x]_x = R_x.$$
Thus I conclude that $\mathscr{O}(U_f) \neq R_f$ in this case. What am I missing?