## Let $A\subset R^{n}$ . Then $A$ is disconnected iff there exists a continuous and surjective functon $f:A\to${0,1} December 2

Let $A\subset R^{n}$ . Then $A$ is disconnected iff there exists a continuous and surjective function $f:A\to${0,1} How can I prove this? To prove $\rightarrow$, I know that if $A$ is disconnected, then there are two open, non empty and disjoint sets