Deformation Retract is Path Connected Here is the problem: Let $X \subset Y$ be topological spaces with $X$ a deformation retract of $Y$.  Then $Y$ is path connected if $X$ is path connected.
This seems simple, but I'm having trouble working out a proof.  Here is what I'm thinking though: if $y,y' \in Y$ are two points, then under the deformation retract $r:Y \to X$, we can form a path $\varphi$ between $r(y) = x$ and $r(y') = x'$.  The problem I run into is using the homotopy $f:Y \times I \to Y$ between $r$ and $\mathrm{id}_Y$, for I can't seem to "lift" the path $\varphi$ to $Y$.
Another thing I was thinking was using the isomorphism $i_*:\pi_1(X,x) \to \pi_1(Y,x)$ for any $x \in X$, and constructing a path from any point $y \in Y$ to a point $x \in X$ via this isomorphism, but I'm having trouble introducing a path to begin with.
This was a problem on an old topology qual.  Hints are welcome.  Thanks! 
 A: Let $A$ be a deformation retract of $X$. Then, let $a,b \in A$. Clearly there is a path $\lambda:[0,1] \to X$ that connects $A,B$. However, since there is a homotopy between  $id:X \to X$ and $i: A \hookrightarrow X$, we can take $F:X \times [0,1] \to A$ with $F \mid_A$ being identity.  
Take the inclusion $\lambda \times id :A \times [0,1] \hookrightarrow X \times [0,1],$ and consider $F \circ (\lambda \times id)$. Then $F_1$ (basically at $X \times \{1\}$ has $A$ as its image, was continunous, and since it fixed elements of $A$, we obtain a path from $a$ to $b$ contained in $A$.

Alternatively, as Ted Shifrin mentions in the comments, $i_*:H_0 \to H_0$ is an isomorphism, so path components of $A$ and $X$ should be the same.
A: More generally one can show that the assignment $\pi_0 : hTop_* \to Set$ is a functor, where $\pi_0(X,x)$ is the set of homotopy classes of maps $(\mathbb{S}^0,0) \to (X,x)$. 
To show $\pi_0$ is well-defined, one first needs to know that if $f,g: X \to Y$ are homotopic, then $\pi_0(f)=\pi_0(g)$. Let $F: X \times I \to Y$ be a homotopy between $f$ and $g$, and let $\phi: \mathbb{S}^0 \to X$ be continuous. Define $G: \mathbb{S}^0 \times I \to Y$ by $G(s,i)=F(\phi(s),i)$. Then $G(s,0)=F(\phi(s),0)=(f \circ \phi)(s)$ and $G(s,1)=F(\phi(s),1)=(g \circ \phi)(s)$. Hence $G$ is a homotopy and so $f$ and $g$ represent the same map $[\mathbb{S}^0, X] \to [\mathbb{S}^0, Y]$, i.e. $\pi_0(f)=\pi_0(g)$. 
Once we have this, it's easy to deduce that $\pi_0(f \circ g)= \pi_0(f) \circ \pi_0(g)$ for any maps $g: X \to Y$ and $f: Y \to Z$, and thus that, for example, the path components of a space and those of its deformation retract are in bijection. 
Note the same proof works to show that for any space $X$, the assignment $[X,-]: hTop_* \to Set$ is a functor (in particular that the $\pi_n$'s are all functors). 
A: The accepted answer seems to show the opposite implication: namely, $Y$ path connected implies $X$ path-connected. However, it is easy to see there is an equivalence. 
In what follows, let $r:Y\rightarrow X$ be the retraction. First, the easy direction:
If $Y$ is path-connected, then $X$ is path-connected. 
Proof: $X=r(Y)$ is the image of a path-connected set. More to the point, if $p:[0,1]\rightarrow Y$ is a path from $x_1$ to $x_2$, then $r\circ p$ is a path in $X$. 
If $X$ is path-connected, then $Y$ is path-connected. 
Proof: Let $y_1, y_2\in Y$. Also let $H:Y\times[0,1]\rightarrow Y$ be the deformation retract. Then the "vertical slice" $H(y_1,-):[0,1]\rightarrow Y$ is a path from $H(y_1,0)=y_1$ to $H(y_1,1)=r(y_1)$. Similarly, there's a path from $y_2$ to $r(y_2)$. This we have a concatenation of paths
$$ y_1\rightarrow r(y_1)\rightarrow r(y_2)\rightarrow y_2 $$
where the middle path exists because $X$ is path-connected. Thus there's a path from $y_1$ to $y_2$. 
A: Let $H:X\times I\rightarrow X$ by the homotopy for which $H(x,0)=x$, $H(x,1)\in A$ for each $x\in X$ and $H(a,t)=a$ for each $a\in A$ and each $t\in I$.
Now, let $a_1,a_2\in A$. Since $X$ is path connected, there exists a path $\gamma:I\rightarrow X$ for which $\gamma(0)=a_1$ and $\gamma(1)=a_2$. Now define $r:X\rightarrow A$ by $r(x)=H(x,1)$.
$r\circ \gamma$ is the desired path in $A$.
