$\DeclareMathOperator\map{map}$I have the following question:
Let $X$ and $Y$ be topological spaces. Let $\map(X,Y)$ denote the space of non-constant continuous functions from $X$ to $Y$. Suppose moreover that each continuous function from $X$ to $Y$ is homotopic to a fixed continuous function $f \colon X \to Y$. In case $f$ is a homeomorphism, is it true that $\map(X,Y)$ is contractible?
I am grateful if anyone has any counterexamples or what conditions must be imposed on $X$ and $Y$ for the question to be true?