In order to prove that a convex subpace $X \subseteq \mathbb{R^n}$ is homotopy equivalent to a point I did the following:
Let $X \subseteq \mathbb{R^n}$ be a convex subspace in Euclidean space and $Y=\{0\}$ be a one point space. Let $x \in X$ and define $f(x) = 0$ and $g(0) = x_0$ for some $x_0 \in X$. Then we have $(f \circ g)(0) = 0$ and $(g \circ f)(x) = x_0$.
However this seems wrong to me since $(f \circ g) = 1_Y$ but $(g \circ f) \neq 1_X$ since $x_0 \neq x$. Where is my reasoning flawed and how can I fix this?