Question regarding the formal completion of affine schemes Let $k$ be any field. We look at the formal completion of $\mathbb{A}^{1}_{k}$ at $0$, i.e. the colimit $X$ of the following diagram in the category of locally ringed spaces,
$$\operatorname{Spec}k[x]/(x) \rightarrow \operatorname{Spec}k[x]/(x^2) \rightarrow \operatorname{Spec}k[x]/(x^3) \rightarrow \cdots  $$
I am trying to understand the underlying topology of $X$. Now each of the affine schemes in the diagram is one point set, so intuitively it seems the colimit should have one point. But rigorously if I need to get any information of the topology of a locally ringed space, I need to apply the forgetful functor $ For : LRS \rightarrow Tops$. And the forgetful functors are usually the right adjoint (though I don't know if there is any adjoint for this one!), so it may not preserve colimit for this diagram.
Maybe I am missing some easy way of understanding this. Thanks in advance!!
 A: The forgetful functor from locally ringed spaces to topological spaces is actually a left adjoint, not a right adjoint; in particular, it preserves colimits.  You can easily see it is not a right adjoint because it does not preserve limits: the terminal locally ringed space is $\operatorname{Spec}(\mathbb{Z})$, but its underlying space is not the terminal topological space (a singleton).
The right adjoint to the forgetful functor is fairly complicated.  Roughly speaking, it takes a topological space $X$, equips it with the constant sheaf $\mathbb{Z}$ (which gives the right adjoint if you were just taking ringed spaces, not locally ringed spaces), and then "expands out" every point of $X$ into new points for each prime ideal in the stalk in order to get a locally ringed space.  For more discussion and references, see this nice answer.
For the specific example you are interested in, you can just easily directly construct the colimit.  Namely, let $X$ be a singleton equipped with the sheaf of rings whose global sections are $k[[x]]$.  This is a locally ringed space, and it has compatible maps from your diagram.  To see that it is the colimit, let $Z$ be any locally ringed space with compatible maps from your diagram.  All these maps must have image that is the same single point $z\in Z$, and we get a compatible system of maps $O_{Z,z}\to k[x]/x^n$ for each $n$.  These induce a map $O_{Z,z}\to k[[x]]$, and this gives a morphism of locally ringed spaces $X\to Z$ that sends the point of $X$ to $z$ and sends a section of $O_Z$ in a neighborhood of $z$ to its image in $k[[x]]$.  Moreover, it is easy to see this is the unique such morphism compatible with the maps from the diagram.
(More generally, you can explicitly construct colimits of locally ringed spaces by taking the colimit of the underlying topological space and then equipping it with essentially the only obvious sheaf of rings you can define.  Of course, the details are much more complicated to check in general than in your example where everything is just a singleton.)
