Connected spaces and constant function

140 Views Asked by At

Let $Y$ a discrete space. Prove that a space $X$ is connected if only if every $f:X\to Y$ is constant.

My incomplete attempt:

Ok, If $X$ isn't connected then there are $A, B $ open sets such that $X = A \cup B$ and $A \cap B = \emptyset$. So we have $ f(X)=f(A \cup B) = f(A) \cup f(B)$, my objective is to show that $f(A) \neq f(B)$ for some $f$ then $f$ isn't constant, But how?

And the otherwise I don't know

1

There are 1 best solutions below

2
On

Ferra's comment is spot-on. Let $Y = \{0\}$. Then for any space $X$ (such as $X = \{1, 2\}$), there's exactly one function from $X$ to $Y$, namely the one defined by: $$ f : Y \to X : y \mapsto 0. $$

Your claim would then show that every space is connected (including my example $X$), which is not true. Hence the claim must be false.