Why doesn't the "zig-zag" comb deformation retract onto a point, even though it's contractible?
Hint: $Z$, being homeomorphic to $\mathbb{R}$, deformation retracts to a point. Compositions of deformation retractions are deformation retractions (composition in the sense of doing the first deformation retraction for $0\leq t\leq \tfrac{1}{2}$, and doing the second for $\frac{1}{2}\leq t\leq 1$). Thus, if $Y$ deformation retracts to $Z$, it must also deformation retract to a point. Do you see why this is impossible? The argument uses Problem 5 in the same section. The details are in a spoiler box below (put your cursor over it to reveal).
By Problem 5, any neighborhood $U$ of such a point would have to contain an open set $V$ whose inclusion $i:V\hookrightarrow U$ is nullhomotopic; however, this is impossible because any open set $V$ will meet non-path-connected parts of $U$.
The following argument uses the compactness of $I$ in a way different from that used in the 'lemma' of problem 0.5 of the book.
To show that the entire space $Y$ cannot deformation retract to any point $x\in Y$, consider a sequence of points $x_{n}\rightarrow x,$ with each point $x_{n}$ being in a unique distinct strand (the red dots in the figure are supposed to represent the points of the sequence $x_{n}$).
If $Y$ deformation retracts to $x\in Y$, there is a continuous path from $x_{n}$ to $x$, for each $n\geq 0 $. Each such path has to pass through the point $B$ at least once. (if you remove the point $B$ from $Y$, then $x_{n}$ and $x$ are in two distinct path components, hence there cannot exist any path between the two points avoiding $B$).
Given $n$, consider the 'time' $t_{n}$ when $x_{n}$ is first mapped to the point $B$. Then consider the sequence $(x_{n},t_{n})\in Y\times I$. Because $I$ is sequentially compact, we have a converging subsequence $t_{n_{i}}\rightarrow t\in I$. Then $(x_{n_{i}},t_{n_{i}})\rightarrow (x,t)$. Let $F:Y\times I\rightarrow Y$ be the continuous map that gives the deformation retraction. Then the sequence lemma implies $F(x_{n_{i}},t_{n_{i}})\rightarrow F(x,t)$. This is a contradiction as $F(x_{n_{i}},t_{n_{i}})=B \ \forall n_{i}\geq 0$ as constructed, and $F(x,t)=x$, because it is a deformation retraction.
A similar argument can be applied to points $z\in Z$, to show both the facts that there is no def. retraction of $Y$ to $Z$, nor one from $Y$ to $z$.