# Can an open and closed function be neither injective or surjective.

I know if a function $$f: X \to Y$$ is bijective, it is open iff it is closed as both are equivalent to $$f^{-1}$$ being continuous.

Now I wonder if a function $$f$$ on two topological spaces is open and closed, must it be bijective? Furthermore, can it be neither injective nor surjective?

I suspect that there is some easy counterexample, but I cannot think of any.

• Your $f$ is surjective Commented Jul 5, 2023 at 17:15
• @FShrike Yeah I'm crazy, give a me a few minutes to fix Commented Jul 5, 2023 at 17:16
• Actually I have not thought about topology for sometime, let me just edit it to bijective, and edit again if I thought about something. I'm not so sure how to temporarily delete a post and put it back Commented Jul 5, 2023 at 17:18
• @TheSilverDoe I don't think this work, $\mathbb{R}$ is closed, but (-pi/2, pi/2) is open Commented Jul 5, 2023 at 17:24
• @wsz_fantasy Yes of course. Commented Jul 5, 2023 at 17:26

Let $$X$$ be any topological space with at least two points, and let $$Y$$ be any topological space with at least two points and an isolated point at 0. (E.g. $$X=Y=\{0,1\}$$ with the discrete topology.) Then $$f:X\to Y$$ defined by $$f(x)=0$$ is open, closed, not injective, and not surjective.

Take any projection $$\pi:X\times Y\to Y$$ where $$X$$ is compact. It's both open (projections are open) and closed (since $$X$$ is compact; this is consequence of tube lemma).

If $$h:Y\to Z$$ is an embedding of $$Y$$ as a clopen subspace of $$Z$$, say $$Z = Y\sqcup Y$$ is disjoint union of two copies of $$Y$$, then $$g = h\circ\pi$$ is continuous, closed, open, not surjective, and not injective (for $$|X| \geq 2$$ and $$Y\neq \emptyset$$)

If you want an easier proof that $$\pi$$ is closed, you might take $$X = Y$$ to be compact Hausdorff. Then image of any closed $$A\subseteq X^2$$ is compact, hence closed since $$X$$ is Hausdorff.

• Why was I downvoted? Commented Jul 5, 2023 at 17:29
• It is not me, but can you elaborate with more details on why it is closed? Commented Jul 5, 2023 at 17:35
• @wsz_fantasy this a standard fact from topology, consequence of tube lemma. See here. Commented Jul 5, 2023 at 17:37
• @Jackobian Thank you. I think it works. I'm not sure about the downvote, but I have given you an upvote. Would it be possible to have an example that is not surjective at the same time? Commented Jul 5, 2023 at 17:44
• Also note that its image actually needs to be clopen, so all non-surjective maps like that are obtained from surjective ones in this way. Commented Jul 5, 2023 at 17:57

If we take $$f: \mathbb{R} \mapsto \mathbb{R'}$$ where $$\mathbb{R}$$ and $$\mathbb{R'}$$ are the real lines with indiscrete and discrete topologies respectively. We define the function as $$f(x)=2 \forall x\in \mathbb{R}$$, then $$f$$ is both open and closed but it is neither injective nor subjective.