# Continuous functions in a metric space using the discrete metric

Let X be any set and define $d: X \times X \to \Bbb R$ by $d(x,y)= \begin{cases} 0 & x=y \\ 1 & x \neq y \end{cases}$.

Classify all continuous functions $f: X \to X$ using the discrete metric on both sets.

This is my first course in topology and I am struggling to make sense of how I would classify all of the continuous functions in this case. I can see that $f(x) \neq f(a)$, then there exists $\epsilon > 0$ which do not satisfy the definition of continuity, so is it just that every continuous function in this case must map all of the elements in the domain to exactly one value in the codomain? Or am I just completely misunderstanding the question?

Thanks!

## 2 Answers

HINT: Is there any function from $X$ to $X$ that is not continuous?

Your comment about what happens when $f(x)\ne f(a)$ suggests that you have some misunderstanding of continuity, because the identity function from $X$ to $X$ is always continuous, no matter what metric you’re using, and it’s never constant unless $X$ has only one point.

• That was my initial thought, but then my friend convinced me that that couldn't be true – Jake Feb 19 '15 at 3:26
• I just want to comment: the identity function is continuous no matter which metric you are using as long as both the domain and codomain are equipped with the same metric. Here I'm thinking of the identity map from $X$ with the indiscrete topology to $X$ with the discrete topology, which isn't continuous (even though technically the domain isn't a metric space). – layman Feb 19 '15 at 3:38
• @user46944: Of course. But that’s the context established by Jake’s question and is also inferable from my use of metric rather than metrics. – Brian M. Scott Feb 19 '15 at 3:42
• Is this only true for the discrete metric since that ensures that every subset of X is open? or other metrics, too? The next question asks to generalize this result, that is, changing any of the conditions of the statement to make them more general, but still retain the same conclusion? – Jake Feb 19 '15 at 4:02
• @Jake: Metrics generating the discrete topology are the only ones for which every $f:X\to X$ is continuous. If $d$ is a metric that does not generate the discrete topology, then there are an $x\in X$ and a sequence $\langle x_n:n\in\Bbb N\rangle$ in $X\setminus\{x\}$ that converges to $x$. Now define $f:X\to X$ as follows: $f(y)=y$ if $y\ne x$, and $f(x)=x_0$. Then $f$ is not continuous, because $\langle x_n:n\in\Bbb N\rangle$ converges to $x$, but $\langle f(x_n):n\in\Bbb N\rangle=\langle x_n:n\in\Bbb N\rangle$ converges to $x$ instead of to $f(x)=x_0\ne x$. – Brian M. Scott Feb 19 '15 at 4:08

In point set topology, we say a function $f: X \to Y$ is continuous if for every open $U \subseteq Y$, $f^{-1}(U)$ is open in $X$ (where this is the preimage of $U$ under $f$).

To characterize all continuous functions $f: X \to X$ where $X$ has the discrete topology, you first have to notice that every subset of $X$ is open with the discrete topology (why?). So really, the topology on $X$ is actually the powerset of $X$ (the set of all subsets).

Also, since every subset is open, then for any subset $U \subseteq Y$, since $U$ is open, we need that $f^{-1}(U) \subseteq X$ is open. But the domain and codomain are both equipped with the discrete topology, and since $f^{-1}(U)$ is a subset of $X$, it is open in the discrete topology. That means any functions you can have from $X$ to $X$ is continuous! Since the preimage of any open set is open, under any function.

• is every subset of X open because we are using the discrete metric, every subset of X is both open and closed? – Jake Feb 19 '15 at 3:43
• Yes you are right. – layman Feb 19 '15 at 3:44
• Is this only true for the discrete metric since that ensures that every subset of X is open? or other metrics, too? The next question asks to generalize this result, that is, changing any of the conditions of the statement to make them more general, but still retain the same conclusion? – Jake Feb 19 '15 at 3:57