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)$?
$C_f|_{X \times [0,1/2]} \xrightarrow{(x,t) \ \mapsto \ (x,2t)} X \times I \xrightarrow{H} Y \hookrightarrow C_g$, where $\hookrightarrow$ is the inclusion function.
– ensbana Jan 30 '21 at 17:28