morphisms of affine schemes question 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

 A: 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: 


*

*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.

*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.
A: You consider $B$ as an $A$-module. Then $f_*O_X$ ($X = Spec B$) is the quasi-coherent $O_Y$-module ($Y = Spec A$) corresponding to the $A$-module $B$. Thus for a prime ideal $y \in Y$, $(f_*O_X)_y$ is the localization of the $A$-module $B$ in $y$.
