$X$ is a connected space and $Y$ is a discrete space prove that the two maps $f,g\colon X\rightarrow Y$ are homotopic if and only if $f=g$. $X$ is a connected space and $Y$ is a discrete space prove that the two maps  $f,g\colon X\rightarrow Y$ are homotopic if and only if $f=g$.
I am trying to solve few problems in algebraic topology, but I don't have deep knowledge in the subject. I guess the reverse direction of proof is trivial, but I am struck with the forward direction. Does the proof include stuff like "for continuous image of connected set to be discrete the map should be constant"? I am a bit confused with the problem. Can someone help me out?
 A: Hint: Use your idea that "the image of a connected space in a discrete space is constant" to the idea of a possible homotopy $H:X\times[0,1]\to Y$.
A: Connectedness of $X$ is not needed.
Suppose that $F:X\times [0,1]\to Y$ is a homotopy from $f$ to $g$.  Fix $x_0\in X$ and consider the continuous function $F_{x_0}(t)=F(x_0,t)$.  By discreteness, the point $F_{x_0}(0)=p\in Y$ is both open and closed, so that $F_{x_0}^{-1}(p)$ is open and closed as well.  Since $[0,1]$ is connected, $F_{x_0}^{-1}(p)$ is either empty, or it is the entire interval.  Since $(x_0,0)\in F_{x_0}^{-1}(p)$, it is not empty, so it must be the entire interval.  This shows that $f(x_0)=F(x_0,0)=p=F(x_0,1)=g(x_0)$.
A: If you assume f,g are both continuous, then the answer is yes, in part because of the reason you gave: the continuous image of a connected set is connected, so that the image of each of $f,g$, is a singleton point. Say$ f(X)=p$, and $g(X)=q$. Now, we must produce a "deformation map" $H:X\times I\rightarrow Y$ , with $H(x,t)$ continuous, and $H(x,0)=p$, and $H(x,1)=q$ . But, again, notice that each of the maps $H(x,t)$, is a continuous map from the connected space $X\times Y $ into the discrete space $Y$, so each of those maps$ H(x,t)$ is just a singleton, so , in our case, it could only be either be p or q. 
