Contractible vs. Deformation retract to a point. [duplicate]

Solution 1:

In exercise 5, that's the one before this one, you showed that "if a space $X$ deformation retracts to a point $x \in X$, then for each neighbourhood $U$ of $x$ in $X$ there exists a neighborhood $V \subset U$ of $x$ such that the inclusion map $V \hookrightarrow U$ is nullhomotopic."

Pick a point $z$ in $Z$ (the zig zag line). Then you can find a neighbourhood $N$ of $z$ that is disconnected and such that every neighbourhood $U$ with $z \in U \subset N$ is also disconnected. Then you apply 5.