Homotopic maps have homotopy equivalent mapping cones Let $f,g:X\to Y$ be maps of spaces such that $f\simeq g$. Is it true that the mapping cones $\operatorname{cone}(f)$ and $\operatorname{cone}(g)$ are homotopy equivalent?
Can we write down an explicit homotopy equivalence? It ought not to be too hard to get a map $\operatorname{cone}(f)\to \operatorname{cone}(g)$ from the existence of a homotopy $H:X\times I\to Y$, but I haven't been able to find a sensible candidate, despite trying for quite a while.
 A: Define the map $k: \text{cone}(f) \to \text{cone}(g)$ by
$$
\begin{align}
% Y \sqcup \left(X\times\left[0,\frac12\right]\right) \sqcup \left(X\times\left[\frac12,1\right]\right)  & \to Y \sqcup \left(X\times I\right) \\
y & \mapsto y \qquad \text{ for } y\in Y \\
(x,t) & \mapsto \begin{cases}
 H(x,2t)  &\text{ if } t\le\frac12\\
 (x,2t-1) &\text{ if } t\ge\frac12
\end{cases}
\end{align}
$$
Can you show that $k$ is continuous?
Now define the "inverse" $l: \text{cone}(g) \to \text{cone}(f)$
$$
\begin{align}
y & \mapsto y \qquad \text{ for } y\in Y \\
(x,t) & \mapsto \begin{cases}
 H(x,1-2t)  &\text{ if } t\le\frac12\\
 (x,2t-1) &\text{ if } t\ge\frac12
\end{cases}
\end{align}
$$
Let $m: \text{cone}(f) \to \text{cone}(f)$ be the map which is the identity on $Y$ and which
$$
(x,t) \mapsto \begin{cases}
 f(x)     &\text{ if } t\le\frac34\\
 (x,4t-3) &\text{ if } t\ge\frac34
\end{cases}
$$
A homotopy between $lk$ and the map $m$ is given by
$$
(x,t,s) \mapsto \begin{cases}
 H(x,2t(1-s))  &\text{ if } t\le\frac12\\
 H(x,(3-4t)(1-s))  &\text{ if } \frac12\le t\le\frac34 \\
 (x,4t-3)   &\text{ if } t\ge\frac34 \\
\end{cases}
$$
Can you show that $m$ is homotopic to the identity on $\text{cone}(f)$?
