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?