Weak deformation retraction (exercise 0.4 from Hatcher) - Proof check

Solution 1:

I agree with the comment by TTS, you need to be a bit more careful in the last step. Your argument does not make use of the fact that $f_t(A)\subset A$ for all $t$, which is crucial.

You are right that $f_1\simeq Id_X$ as maps $X\to X$ but this does not immediately imply that $f_1\circ i$ and $Id_A$ are homotopic as maps $A\to A$. What you need is that $f_1|_A\simeq Id_X|_A$ as maps $A\to A$. To show this the assumption $f_t(A)\subset A$ for all $t$ is required.

To illustrate what might go wrong if we dropped the assumption $f_t(A)\subset A$ for all $t$, consider the following example.
Let $S^n\subset \mathbb{R}^{n+1}$ be the unit sphere of odd dimension $n>1$. Then the antipodal map $$ -Id:S^n\to S^n: x\mapsto -x $$ is homotopic to the identity map $Id_{S^n}$ via $$ f_t(x) = \cos(t) x+\sin(t)v(x) \quad t\in[0,\pi]\quad f_0=Id_{S^n} \quad f_\pi=-Id $$ where $x=(x_1,\ldots,x_{n+1})\in S^n$ and $v(x)=(x_2,-x_1,x_4,-x_3,\ldots,x_{n+1},-x_n)\in S^n$.
Now we intersect $S^n$ with any $3$-dimensional linear subspace of $\mathbb{R}^{n+1}$ in order to get a $2$-sphere $S^2\subset S^n$. Even though $-Id$ and $Id_{S^n}$ are homotopic as maps $S^n\to S^n$, their restrictions $$-Id|_{S^2}\text{ and }Id_{S^n}|_{S^2}$$ to $S^2\subset S^n$ are not homotopic as maps $S^2\to S^2$. The reason for this is because they don't have the same degree ($1=\deg(Id|_{S^2})\neq\deg(-Id|_{S^2})=(-1)^3=-1$, see Section 2.2 in Hatcher's book) and the degree of a smooth map is invariant under homotopy.
Notice that, whatever $2$-sphere $S^2\subset S^n$ you choose, the homotopy always violates the condition:
$$f_t(S^2)\subset S^2 \text{ for all }t\in[0,\pi].$$