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