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)$.
Any help please. Thanks in advance.
 A: Let me address all the points here:

*

*If $X$ is connected and $Y$ totally disconnected, then only constant functions $X\to Y$ are continuous.

*If $X$ is disconnected and $Y$ has at least two points then there exists a non-constant continuous function $X\to Y$.

*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.

*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.

