# Direct image of locally ringed space

Let $$(X,\mathcal{O}_X)$$ be a ringed space and $$Y$$ be topological space and $$f: X \to Y$$ a continuous map. Then $$(Y,f_*\mathcal{O}_X)$$ is obviously a ringed space, where $$f_*\mathcal{O}_X$$ is the direct image.

Is it true that if $$(X,\mathcal{O}_X)$$ is locally ringed that $$(Y,f_*\mathcal{O}_X)$$ is also locally ringed? If $$f$$ is a homeomorphism that is clearly the case. But I don't know if it is true in general. For $$y \in Y$$ it is $$(f_*\mathcal{O}_X)_y = \varinjlim_{y \in U} \mathcal{O}_X(f^{-1}(U))$$ but no obvious connection to $$\mathcal{O}_{X,x}$$ for some $$x \in X$$. Does someone have a counterexample?

Maybe this is true if $$f$$ is a topological embedding or similar?

EDIT: My answer shows that is not true even for closed topological embeddings (which are no homeomorphisms). But in this case it is "nearly" locally ringed, so all rings which are not local are zero. Is there some use of "nearly" locally ringed spaces or a correct notion for such ringed spaces?

Let $$X$$ be a topological space and $$Z \subsetneq X$$ a proper closed subset and $$(Z,\mathcal{O}_Z)$$ be a locally ringed space. Let $$\iota: Z \hookrightarrow X$$ the inclusion. Then $$(X, \iota_*\mathcal{O}_Z)$$ is not locally ringed: for $$p \in Z$$ it is $$(\iota_*\mathcal{O}_Z)_p = \mathcal{O}_{Z,p}$$, so a local ring, but for $$p \in X\setminus Z$$ it is $$(\iota_*\mathcal{O}_Z)_p = 0$$ and the zero ring is NOT local. Therefore even for closed topological embeddings which are no homeomorphisms the direct image of a locally ringed space is not locally ringed.