# If $f\colon X\to Y$ is an almost one-to-one continuous map from the connected space $X$ onto $Y$, then, is it a homeomorphism?

Let $$X,Y$$ be metrizable compact spaces, with $$X$$ connected, and $$f\colon X \to Y$$ a continuous function onto $$Y$$. Suppose $$f$$ is almost one-to-one in the following sense: there exists $$Y' \subseteq Y$$, a dense $$G_\delta$$, such that $$\# f^{-1}(y) = 1$$ for all $$y \in Y'$$. Then, can happen that $$Y\setminus Y'$$ is dense in $$Y$$?

I have this situation in another problem and it is hard for me to image a that $$Y$$ has both a dense set of point where $$f$$ has a unique preimage and a dense set of points where $$f$$ has two or more preimages.

• "$Y\setminus Y'$ is either dense in $Y$ or empty". If it is empty, then $f$ is trivíally injective. You should omit this case because it only leads to irritation. What abou the case that $Y\setminus Y'$ is non-empty but not dense? Jul 1, 2020 at 8:19
• @PaulFrost The case in which $Y\setminus Y'$ is non-dense and non-empty don't occur in my problem. Jul 1, 2020 at 13:54

Yes, it can. For instance, let $$X=\{(x,y)\setminus [0,1]^2:y\le D_M(x)\}$$, where $$D_M(x)$$ is a modified Dirichet function and $$f$$ be the projection of $$X$$, $$(x,y)\mapsto x$$.