Let $X$ and $Y$ be Riemann surfaces, and $\mathscr{O}_X, \mathscr{O}_Y$ be the sheaves of holomorphic functions on $X$ and $Y$ respectively.
It is obvious that a holomorphic map $f:X \to Y$ gives rise to a morphism of locally ringed spaces $(X, \mathscr{O}_X) \to (Y, \mathscr{O}_Y)$.
I was always under the impression that a morphism of locally ringed spaces also gave rise to a holomorphic map, but I can't for the life of me prove it. I cant see why the induced stalk maps being local homomorphisms forces the topological map to be holomorphic.
Any help would be appreciated!