Proof for nonhomotopy 
Let $Z =S^1 \times I$, and let $X = S^1 \times \{ 0 \}$ and $Y = S^1 \times \{1\}$ be two subspaces of $Z$. Let $f$ be a map from $Z$ to itself, sending $(z,t)$ to $(z \cdot e^{2 \pi it}, t)$, where $z \in S^1$ and $t \in I$. Prove that $f$ and the identity map on $Z$ are not hompotopic relative to $X \cup Y$.

It's easy to construct a homotopy between the identity map on $Z$ and $f$, but what is the general method to rule out the possibility of a relative homotopy?
Thanks a lot.
 A: The answer to this question comes down to contemplating the two torus. Note that on both ends of the cylinder, the map, $f(z,i)=id,i=0,1$. This means that we may create a map $\pi:Z\to T^2$ defined by $$\pi(z,t)=(z,e^{2\pi it})$$, where $T^2$ is the two torus.  Note that we also have a commuting square $$\begin{array}{ccc} Z & \rightarrow & Z \\ \downarrow & & \downarrow & \\  T^2 & \rightarrow & T^2 \end{array}$$ where the upper horizontal map is the map $f$ that you described, and the vertical maps are both $\pi$. We should now describe the lower horizontal map. We will now create a map, $\phi:T^2\to T^2$. $\phi(z,\theta)=(ze^{2\pi i(+\theta)},e^{2\pi i\theta})$, where $z$ is a complex number of modulus one and $t\in\mathbb{R}/\mathbb{Z}$. Let us now desribe what the picture of this   

Now note that two maps, $id,f:Z\to Z$ are homotopic rel $X\cup Y$, then $\phi$ is homotopic to $id_{T^2}$. 

But if we compute the map on fundamental groups, $$\pi_1(\phi):\mathbb{Z}\oplus\mathbb{Z}\to\mathbb{Z}\oplus\mathbb{Z}$$, we get $\pi_1(\phi)(m,n)=(m+n,n)$ which implies that $\phi$ is not homotopic to the identity which in turn implies that $f$ is not homotopic to the identity relaive to the subset $X\cup Y$.
This leads to a (not completely) general method (different from computing relative homologies). When you have a pair if maps, $\iota_i Y\hookrightarrow X,i=1,2$ and you want to know if two maps are homotopic relative the set $Im(\iota_1)\cup Im(\iota_2)$, then we can test if the induced maps in the coequalizer of the pair $(\iota_1,\iota_2)$ are homotopy equivalent.
Edit
Let us describe the picture of some of these maps. The map $\pi:Z=S^1\times I\to S^1\times S^1$ attaches the two ends of the cylindar. Rewriting the map using angle notation instead of complex notation, we get $$\mathbb{R}/\mathbb{Z}\times[0,1]\to\mathbb{R}/\mathbb{Z}\times\mathbb{R}/\mathbb{Z}$$ where the map on the second factor, $$[0,1]\to\mathbb{R}/\mathbb{Z}$$, is given by $$s\mapsto s\mod\mathbb{Z}$$. Now the map $$\phi:T^2=\mathbb{R}/\mathbb{Z}\times\mathbb{R}/\mathbb{Z}\to T^2=\mathbb{R}/\mathbb{Z}\times\mathbb{R}/\mathbb{Z}$$ may be rewritten as $$(s_1,s_2)\mod\mathbb{Z}\otimes\mathbb{Z}\to (s_1+s_2,s_2)\mod\mathbb{Z}\otimes\mathbb{Z}.$$ Note that all this map is doing is that it cuts open the torus about a non-trivial circle, twists the cylinder around by 360 degrees and reattaches. Contemplating what happens at the universal cover will give you what happens on the fundamental group.
