So, in chapter 2, section 2 of Hartshorne, (prop 2.3), he describes how if $\varphi : A\rightarrow B$ is a homomorphism of rings, then you get a morphism of (affine schemes):


$\newcommand{\Spec}{\textrm{Spec }}$
$\newcommand{\oO}{\mathcal{O}}$
$\newcommand{\mf}[1]{\mathfrak{#1}}$
$(f,f^\sharp) : (\Spec B, \oO\_{\Spec B})\rightarrow (\Spec A, \oO\_{\Spec A})$


where $f:\Spec B\rightarrow\Spec A$ is given by $f(\mf{p}) = \varphi^{-1}(\mf{p})$. Here, for each $\mf{p}\in\Spec B$, $\varphi$ also gives us a map of localizations $\varphi\_\mf{p} : A\_{\varphi^{-1}(\mf{p})}\rightarrow B\_\mf{p}$.


Also, $f^\sharp : \oO\_{\Spec A}\rightarrow f\_\*\oO\_{\Spec B}$ is given by sending $\sigma\in\oO\_{\Spec A}(V)$ (for each open $V$), to the function $[\mf{p}\mapsto \varphi\_\mf{p}(\sigma(f(\mf{p})))] \in \oO\_{\Spec B}(f^{-1}(V)) = f\_\*\oO\_{\Spec B}(V)$


So, my question is... What are the stalks of the direct image sheaf $f\_\*\oO\_{\Spec B}$?


This is clearly a sheaf on $\Spec A$, so there should be a stalk for each $\mf{p}\in\Spec A$. There are two cases.


Firstly, suppose $\mf{p}\in\Spec A$ is in the image of $f$, then by definition, the stalk of $(f\_\*\oO\_{\Spec B})\_{\mf{p}}$ is the direct limit:


$\lim\_{U\supset f^{-1}(\mf{p})}\oO\_{\Spec B}(U)$


But this is not quite a stalk of $\oO\_{\Spec B}$ (since $f$ may not be injective). However, Hartshorne seems to suggest that this is actually just $(\oO\_{\Spec B})\_{\mf{q}}$ which is just the localization of $B$ at $\mf{q}$, where $\mf{q}$ is any point of $f^{-1}(\mf{p})$. I don't really see why this must be true. (Especially since he seems to suggest that all the localizations at $\mf{q}$ are the same, for any $\mf{q}\in f^{-1}(\mf{p})$.


Secondly, suppose $\mf{p}\in\Spec A$ is not in the image of $f$. Then what? I can imagine that if there is some neighborhood $V$ of $\mf{p}$ such that $f^{-1}(V)$ is empty, then the stalk would be zero. But suppose there is no such $V$? Then What? (Alternatively, must there always exist such a $V$ in this case?)


Thanks guys


* will



morphisms of affine schemes question
I'm not sure what it is that you read in Hartshorne that suggested that $(f\_\*\mathcal O\_{\mathrm{Spec} B})\_{\mathfrak p}$ is equal to $(\mathcal O\_{\mathrm{Spec} B})\_{\mathfrak q}$, since this is not true.


My suggestion is that you consider two illustrative cases: 


1. Let $A = k$ (a field) and $B = k\times k$, with $A \to B$ the diagonal morphism. In this
case Spec $A$ is a single point, and so there is only stalk to consider.
2. Let $A = k[t]$ (again, $k$ is a field) and $B = k[t,t^{-1}]$, with $A \to B$ being the inclusion. In this case, the map Spec $B \to $ Spec $A$ coicides with the identity
at all point of Spec $A$ other than the point $t = 0$, so the interesting case is the
stalk of the pushforward at $t = 0$ (this is a case with empty fibre).


In each case you can compute the stalk you asked about directly from the definition,
and I recommend that you try to do so.


Added: If $f: X \to Y$ and $\mathcal F$ is a sheaf on $X$, then for any $x \in X$
there is a canonical map of stalks $(f\_\*\mathcal F)\_{f(x)} \to \mathcal F\_x,$
given as follows: if $V$ is a n.h. of $f(x)$, then $f^{-1}(V)$ is a n.h. of $x$,
and by definition $f\_\*\mathcal F(V) = \mathcal F(f^{-1}(V)).$ If $V$ runs over *all* n.h.s of $f(x)$, then $f^{-1}(V)$ will range over some (but typically not all) n.h.s of $x$,
and so there will be an induced map $(f\_\*\mathcal F)\_{f(x)} \to \mathcal F\_x$, but
this will typically not be an isomorphism (exactly because $f^{-1}(V)$ typically doesn't
range over *all* n.h.s of $x$, but just certain ones). In the case of a morphism $f:X \to Y$ 
of ringed spaces, the given map $\mathcal O\_Y \to f\_\*\mathcal O\_X$ then induces maps of stalks $(\mathcal O\_Y)\_{f(x)} \to (f\_\*\mathcal O\_X)\_{f(x)}$ (by functoriality of the
construction of stalks) and $(f\_\*\mathcal O\_X)\_{f(x)} \to (\mathcal O\_X)\_x$ (via the
above construction). Their composite is the morphism
$(\mathcal O\_Y)\_{f(x)} \to (\mathcal O\_X)\_x$ that Hartshorne uses when he makes the definition of a morphism of locally ringed spaces.


