This is a question related to a question I asked here.
I've been thinking about how to prove that if $A \subset X$ where $A$ and $X$ are disconnected spaces and $A$ is a (strong) deformation retract of $X$ and $i: A \hookrightarrow X$ is the inclusion then $i$ cannot be homotopic to the constant function.
I can argue as follows: If $A$ is a deformation retract of $X$ then $i$ induces an isomorphism on the fundamental groups. Then, because homotopic maps induce the same homomorphism on fundamental groups, this would lead to the contradiction that the trivial group (generated by the image of the constant function) is isomorphic to the non-trivial group (generated by the disconnected domain of the constant function).
I really wanted to prove this directly from first principles but I didn't manage. Can someone give me the direct proof? I would appreciate it very much. Thanks for your help!