# Existence of non-constant continuous function

Let both $$(X , d)$$ and $$(Y , d)$$ are non-trivial connected metric spaces. That is both $$X$$ and $$Y$$ contains at least two elements each.

Is it true that there always exist a non-constant continuous function from $$(X ,d)$$ to $$(Y ,d)$$. I know that if $$(X ,d)$$ is connected and $$(Y ,d)$$ is totally disconnected (i.e connected components of $$(Y ,d)$$ are the one-point sets) then there cannot exist a non-constant continuous function from $$(X , d)$$ to $$(Y , d)$$. Also if $$(X ,d)$$ is not connected then no matter what is the structure of $$(Y ,d)$$ there always exist a non-constant continuous function. Furthermore, with the mentioned assumptions if the cardinality of $$X$$ is less than or equal to $$Y$$ then is it true that there always exist an injective continuous map from $$(X ,d)$$ to $$(Y ,d)$$.

• I don’t have time to think about it right now, but it’s true under the stronger assumption that $Y$ is path connected, even if $X$ is Tikhonov rather than metric. Let $x_0,x_1\in X$ with $x\ne y$, and let $f:X\to[0,1]$ be such that $f(x_0)=0$ and $f(x_1)=1$; connectedness of $X$ implies that $f[X]=[0,1]$. Let $y_0,y_1\in Y$ with $y_0\ne y_1$; then there is a path $g:[0,1]\to Y$ such that $g(0)=y_0$ and $g(1)=y_1$. The map $g\circ f$ is a non-constant continuous function from $X$ to $Y$. Mar 4 at 8:25
• @ Brian M.Scott Can you please give some hint , why the function f from X to [0 , 1] as you have defined is a continuous function. Mar 4 at 10:06
• The existence of such a function is an immediate consequence of the the fact that $X$ is a Tikhonov space. Mar 4 at 19:22
• Thanks for the clarification. Mar 5 at 5:05

1. If $$X$$ is connected and $$Y$$ totally disconnected, then only constant functions $$X\to Y$$ are continuous.
2. If $$X$$ is disconnected and $$Y$$ has at least two points then there exists a non-constant continuous function $$X\to Y$$.
3. If $$X$$ and $$Y$$ are connected then it doesn't mean that there is a non-constant continuous function $$X\to Y$$. Consider $$X=[0,1]$$ and let $$Y$$ be the pseudo-arc. The pseudo-arc is well known to be connected but totally path-disconnected (any such space will work) and so every continuous map $$X\to Y$$ is constant. This example also answers the question about cardinalities.
4. If $$X$$ is any metric space and $$Y$$ is path connected, both with at least two points, then there is always a non-constant map $$X\to Y$$. Let $$x,y\in X$$, $$x\neq y$$. By Tietze extension theorem the function $$\{x,y\}\to[0,1]$$ that maps $$x$$ to $$0$$ and $$y$$ to $$1$$ extends to $$A:X\to [0,1]$$. We then compose that $$A$$ with any path $$[0,1]\to Y$$ connecting two distinct points.
• As a side note, since $Y$ is not supposed to be compact, there's an example easier than the pseudo-arc: the Knaster–Kuratowski fan Mar 4 at 13:25