# Are the maps homotopic?

Let $f, g:X\rightarrow Y$ be maps between topological spaces such that $g\circ f^{-1}:Y\rightarrow Y$ is homotpic to the constant map. Is it true that $f$ and $g$ are homotopic?

I would say no, in general they are not. Consider the following counterexample. Take $X$ to be a circle $S^1$, $f = \operatorname{id}_{S^1}$ be the identity on $X$ and $g$ be arbitrary constant map $g \colon S^1 \rightarrow S^1$. Then $g \circ f^{-1} = g \circ \operatorname{id}_{S^1} = g$ is a constant map and it is not homotopic to the indentity map on $S^1$.