{0,1} is not a retract of [0.1] Knowing that $Y\subset X$ is a retract of a topological space $X$ if there exists a continuous function $r:X\to Y$ such that $r(y)=y\quad\forall y\in Y$, I don't know how to show that $\{0,1\}$ is not a retract of $[0,1]$.
I tried to demonstrate it by finding the function $r:[0,1]\to \{0,1\}$ defined by $$x\to r(x)=\cases{0 & $x\ne1$\\1 & $x=1$}$$
which is not continuous and then cannot be a retraction, but it is not sufficient to show that a retraction cannot exist.
How can I continue?

The image of a connected space by a continuous map is connected, so this is impossible.
