Defining continuous inverse of continuous open map

Bit of a silly question, but here it goes:

We know that if a bijective continuous map is open, its inverse is continuous. But now suppose you have a surjective, open continuous map $$f:X\rightarrow Y$$. If I just pick an element $$z\in f^{-1}(y)$$ for every $$y$$ and then define $$g:Y\rightarrow X$$ with $$g(y)=z$$, will this $$g$$ be continuous (and be an inverse to $$f$$)? If not, is this possible if I add the constraint that $$f^{-1}(y)$$ is finite for every $$y\in Y$$?

• $g^{-1}(A)=f(A)$ by elementary set theory. Thus $g$ is continuous... May 17 '19 at 11:01

Your map $$g$$ is a right inverse (or a section) for $$f$$ which means $$f \circ g = id_Y$$. However, if $$f$$ is not bijective, then $$g \circ f \ne id_X$$, so it is not a left inverse.
To see that $$g$$ is continuous, let $$U \subset X$$ be open. Then $$g^{-1}(U) = g^{-1} (f^{-1}(f(U))) = (f \circ g)^{-1}(f(U)) = f(U)$$ is open in $$Y$$. Note that in general $$g$$ is not an open map. In fact, in general not even $$g(Y)$$ will be open in $$X$$.