Consider a commutative local ring R, say a valuation domain, with maximal ideal M. Consider the fiber product $R \times_M R$ (I wrote M instead of R/M), coming from the pullback in commutative rings $R\rightarrow R/M$. Then the corresponding prime spectra of this fibered product (in rings) is actually a form of gluing of the same same (affine) scheme Spec R along the closed point M. So this is the case where this happens.
So I think you can do such things for affine Schemes. For affine schemes, you can at least reverse the topology (they are sometimes called inverse spectrum) and you can form a sheaf over this topology similar to the canonical structure sheaf, but the closed points becomes the generic points in this topology. I cannot recall correctly, but I think the stalks of this sheaves become integral domains (so it is some form of dual to the affine schemes, local becomes integral and so on)
Courtesy of Jim Borger
– Greg Stevenson Nov 12 '09 at 20:08You should always be able to do this assuming both points can be represented as points in the same affine patch (if not more generally). Hm, if you have two points which can't live on the same affine patch due to failure of separatedness, I'm not sure what happens if you try to glue them.
– Karl Schwede Apr 16 '10 at 16:33