# $f : X \rightarrow \{0,1\}$ satisfying $f(0) =0$ and $f(1) =1$ exist?

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

$$a) X=[0,1]$$

$$b)X=[-1,1]$$

$$c)X=\mathbb{R}$$

$$d)[0,1] ⊄X$$

i was thinking about the function $$f(x) = x$$ that is $$f(0) =0$$ and $$f(1) =1$$ and i don't know how to tackle this question

Any hints/solution

thanks u

• $f\colon X \to \{0,1\}, x\mapsto x$ is not well defined on the four choices of $X$. For example, in a) $f(\frac12)=\frac12 \notin \{0,1\}$. – Babelfish Oct 1 '18 at 12:01
• @Babelfish thanks u – jasmine Oct 1 '18 at 12:14