# For which subspace a continuous function satisfying given conditions will exist?

For which subspace $$X \subseteq \mathrm{R}$$ with usual topology and with $$\{0,1\}\subseteq X$$, will a continuous function $$f: X \to \{0,1\}$$ satisfying $$f(0)=0$$ and $$f(1)=1$$ exist?

1. $$X= [0,1]$$
2. $$X= [-1,1]$$
3. $$X= \mathrm{R}$$
4. $$[0,1] \not \subset X$$
• Tip: Let $X$ be a connected topological space and $f: X \rightarrow \{0,1\}$ a continuous function, then $f$ is constant. – G. Chiusole 2 days ago

Since for the first three options the domains are connected but the range is not connected the only possible case is the fourth option which $$[0,1] \not \subset X$$