Do closed immersions preserve stalks? This questions stems from an earlier confusion about the distinction between open and closed immersions between schemes.
I understand that an open immersion $U\to S$ can simply be read as an open subset $U\subseteq S$, as the only scheme structure you can put on $U$ which is in a sense "compatible" with the inclusion into $S$ is that given by restricting the structure sheaf of $S$ to $U$. Consequently the stalk $O_{U, u}$ for any $u\in U$ should be isomorphic to that same stalk $O_{S, u}$ for $S$.
I used to hold the false belief that closed immersions could similarly be identified with closed subsets. I now understand that a closed subset of a scheme can of course admit many different scheme structures - in fact, every closed subset can be considered a closed immersion from a reduced scheme! However, I wonder if at least some of that intuition is correct. Do closed immersions still preserve stalks?
I suppose this can be reduced to the affine case, so that we can simply ask "if $f:R\to T$ is a surjective morphism of rings, and $p\in Spec(T)$, then is it the case that $T_p \cong R_{f^{-1}(p)}$?" This does not appear obviously to be true.
A further question if this is false is ... what is the point of closed immersions? What is the intuition behind them? The course I am studying never really addressed such questions.
 A: Notation: $A^n_{\mathbb{C}}$ is the affine space of dimension $n$ over complex numbers, $P^n_{\mathbb{C}}$ is the projective space of dimension $n$ over complex numbers.
Take $X=\mathrm{Spec}\,\mathbb{C}$, $Y=A^1_{\mathbb{C}}$, $f:X\rightarrow Y$ the inclusion of the origin. Let $x$ be the unique point of $X$. Then $O_{X, x}=\mathbb{C}$, $O_{Y, f(x)}=\mathbb{C}[x]_{(x)}$. These two can not be isomorphic because one is a field and the second is not. 
You are asking what is the point of closed immersions if they do not preserve stalks. The point is that many morphisms of schemes people are interested in do not preserve stalks (just as the example above). The intutition is that a closed immersion is roughly the same as inclusion of a subset of your variety which is defined by polynomial equations–a very natural notion in my mind. As you say, when you pass from the world of varieties to the world of schemes you have to take into account the possible non-reducedness of your subsets (it is not too bad, however; if the source of the closed immersion is reduced, then your closed immersion has to factor through the "reduction" of the target). 
One might ask: what are some good properties of of closed subschemes? For example, closed immersions are proper (and the composition of proper morphisms is proper) so for any scheme $S$, a closed subscheme of a proper $S$-scheme is a proper $S$-scheme. This obviously does not hold for open immersions (consider $A^1_{\mathbb{C}}$ as a subscheme of $P^1_{\mathbb{C}}$). 
Another example is that a closed subscheme of an affine scheme is also an affine scheme. An open subscheme of an affine scheme does not have to be affine: take $A^2_{\mathbb{C}}$ and consider the complement of the origin; this open subscheme has the same ring of global functions as $A^2_{\mathbb{C}}$ by Hartogs lemma; so if it were affine, it would be isomorphic to $A^2_{\mathbb{C}}$ and this is not the case becase e.g. their cohomologies are different). Note that in dimension 1, modulo some finiteness hypotheses, an open subscheme of an affine scheme is affine. In general, the question of which open subschemes of an affine scheme are affine can be pretty interesting. 
Now, if you required closed immersions to preserve stalks, you would not get a very wide class of morphisms (essentially only inclusions of connected components). 
Claim. A closed immersion that preserves stalks, whose source is non-empty and whose target is integral is an isomorphism. 
Proof. Let $i:X\rightarrow Y$ be the morphism in question. Pick a point in the image and choose its affine open neighbourhood $U=\mathrm{Spec}\,R$. $R$ is an integral domain because target is integral. $i$ restricts to a map $\mathrm{Spec}\,R/I\rightarrow \mathrm{Spec}\,R$ for some ideal $I$. Consider the stalks at our chosen point; projection $R_{\mathfrak{p}}\rightarrow (R/I)_{\mathfrak{p}}$ has to be an isomorphism. Note that $(R/I)_{\mathfrak{p}}\approx R_{\mathfrak{p}}/I_{\mathfrak{p}}$ so $I_{\mathfrak{p}}=0$. Now note that in an integral domain, localization of a non-zero module at a prime ideal can never give you zero; so $I$ is zero, therefore the image of $i$ is a closed set (by definition of closed immersion) that contains $U$, an open dense set (in an irreducible space, any non-empty open subset is dense). So $i$ is surjective. The requirement that $i$ preserves stalks implies that $i$ is flat. Surjective flat closed immersions are isomorphisms. 
I am not sure if this claim holds if you assume that the target is only irreducible as opposed to integral. 
Claim. A closed immersion locally of finite presentation that preserves stalks, has a non-empty source and a connected target is an isomorphism. In particular, a closed immersion that preserves stalks, has a non-empty source and a connected locally Noetherian target is an isomorphism. 
Proof. As remarked above, such a morphism has to be flat. Flat morphisms locally of finite presentation are universally open; so the image of our morphism is a non-empty clopen set so it has to be the whole target (by connectedness). Surjective flat closed immersions are isomorphisms. For the second sentence, note that closed immersions are always of finite type and morphisms of finite type to a locally Noetherian scheme are of finite presentation. 
Note that the claim is not true without finite presentation assumption (see here for a counterexample with affine source and target). 
As a general advice, I can recommend to you to read the textbook of Ravi Vakil. He is a well-known algebraic geometer and he spent many years writing and re-writing it so in my opinion, it is by far the best textbook in the field. It has really understandable explanations. 
A: This isn't true, for a simple example you can take $R=\mathbb Z$, $T=\Bbb Z/p\Bbb Z$ and $f:R\to T$ to be the natural surjection (i.e. going modulo $p$). The only prime ideal of $T$ is the zero ideal $\mathfrak p=(0)$, and its pre-image under $f$ is $f^{-1}(\mathfrak p)=(p)$, so we find that $$R_{f^{-1}(\mathfrak p)}=\mathbb Z_{(p)}\quad\text{but}\quad T_{\mathfrak p}=\Bbb Z/p\Bbb Z,$$
these definitely are not isomorphic rings, for instance the one on the right is finite but the one on the left contains $\Bbb Z$.
