# If $f:X \to [0,1]$ be an onto continuous map and $\{f^{-1} (y)\}$ is compact then Is $X$ compact?

If $f:X \to [0,1]$ is an onto continuous map and $\{f^{-1} (y)\}$ is compact for every $y \in [0,1]$, then is X necessarily compact?

Now continuous image of a compact set is compact. Again $X$ is the uncountable union of compact sets but to get any conclusion?

• Do you mean $\{f^{-1} (y)\}$ is compact for each $y$ in $[0,1]$? Commented May 19, 2015 at 16:44

No, it doesn't have to be. Counterexample: endow $[0,1]$ with the discrete topology, $\mathcal T_{dis}$. Call the standard topology on $[0,1]$ $\mathcal T_{Euc}$. Now consider the identity function: $$\mathrm{id}:([0,1],\mathcal T_{dis})\longrightarrow ([0,1],\mathcal T_{Euc}) \atop \qquad x\mapsto x$$ Then $f^{-1}(\{y\})=\{y\}$ for all $y\in[0,1]$ yet $([0,1],\mathcal T_{dis})$ is not compact.

• Nice answer ;-). I don't really need/want any more reputation, so I'll delete mine in a second. Commented May 19, 2015 at 16:46
• @JasonDeVito The misterious placement of answers seems to have gotten me the accept even though I was 5 seconds later. MSE is weird Commented May 19, 2015 at 16:56
• No worries - I don't need the rep. Commented May 19, 2015 at 17:03
• @JasonDeVito Haha, strictly speaking I don't "need" it either (do I?), but I do appreciate it, thanks. I do say the frequency of this sort of thing - same counterexample within 5 seconds - on this site is quite astounding. Commented May 19, 2015 at 17:09

Here is a simple counter-example which proves that $X$ is not necessarily compact. Let $X=[0,1)$ which is not closed then not compact. and $f(x)=x(1-x)$ for $x$ in $X$. Then the range is exactly $[0,1]$ and $f$ is continuous. EDIT. Topologies are usual ones on $X$ and on the range.