I'm trying to prove the following statement, but I am stuck.
Let $X$ and $Y$ be topological spaces. If one of them is a contractible space, then every continuous function from $X$ to $Y$ is homotopic to a constant map.
Start of my solution: Assume, without loss of generality, that $X$ is a contractible space. Then the identity map $\mathrm{id}_{X}:X\to X$ is nullhomotopic such that $\mathrm{id}_{X}\simeq c$, where $c$ is some constant map. In other words, there exists a continuous function $F:X\times[0,1]\to X$ such that $F(x,0)=\mathrm{id}_{X}$ and $F(x,1)=c$. Let $f:X\to Y$ be a continuous function. Then....
That's where I'm stuck. I'm not sure how to show that any arbitrary continuous function is necessarily homotopic to a constant map. Thanks in advance for any help!
Let $g:X \to Y$ be the function $g(x)=f(c)$. Then $g$ and $f$ are homotopic using the function $G: X \times [0,1] \to Y$ which is $G(x,r)= f(F(x,r))$. Then $G(x,0)=f$ and $G(x,1)=g(x)= f(c)$.