Proving that the empty glass is a deformation retract of the full glass Let me write down the exercise described in the title formally. 
Let $X=E^2 \times I$ and $A=E^2 \times {0} \cup S^1 \times I$, where $E^2$ designates the ball of radius 1 in $\mathbb{R}^2$. 
I want to show that $X$ is a deformation retract of $A$. 
I must give a continous function $F:X\times I\rightarrow X$ that
meets the 3 requirements below:


*

*$F(x,0)\in A$ for all $x\in X$;

*$F(x,1)=x$ for all $x\in X$;

*$F(a,t)=a$ for all $a\in A$ and for all $t\in I$.


Let $F(x,t)=t\cdot x+(1-t)\cdot\theta(x)$, where $\theta(x)$ is
the intersection between $A$ and the line that unites $x$ to the
point $(0,0,2)$. It's easy to see that $F$ meets the conditions above. 
My question is how do I reason that this function is indeed continuous? Hatcher (Proposition 0.16) mentions something about the continuity of this map in a language completely foreign to me (due to my null knowledge of algebraic topology). 
 A: While @String gave you the explicit formula for $\theta$ I will show you how to generalize it to any "good enough" closed subset and a projection onto it.
So what is $\theta$?

More generally consider a Banach space $E$, a fixed vector $w\in E$ and a closed subset $A\subseteq E$ such that $w\not\in A$. Now for any $v\in E$ consider following sets
$$I_v=\big\{tv+(1-t)w\ \big|\ t\in\mathbb{R}\big\}$$
$$A_v=I_v\cap A$$
$$B=\{v\in E\ |\ A_v\neq\emptyset\}$$
and the multivalued function
$$f:B\multimap E$$
$$f(v)=A_v$$
I leave as an exercise that $f$ is lower semicontinuous.
Now  you can easily check that $A_v$ is closed. Assume that $A_v$ is additionally convex for each $v\in B$. Since $B$ is paracompact (as a metric space) the Michael selection theorem applies to $f$ and thus there exists a continuous selection $s:B\to E$ (i.e. $s(v)\in f(v)$).

In our case $E=\mathbb{R}^3$, $w=(0,0,2)$ and $A=E^2\times\{0\}\cup S^1\times I$. You can easily check that $A_v$ has exactly one point if non-empty. Thus $A_v$ is convex and by the Michael selection theorem there is a continuous selection. Note that this selection is unique (simply because $A_v$ has one point). The restriction of that selection to $X$ is equal to $\theta$.
A: To prove that $\theta$ is continuous, the idea is to convert the geometric description given into a formula for $\theta$, and then to apply that formula. You'll be using what you know from calculus and analytic geometry, with a bit of topology, to prove that $\theta$ is continuous (so it's not algebraic topology that you use to prove continuity).
But, there is a twist: the formula will be in two pieces, corresponding to the two pieces in the expression
$$A = (E^2 \times 0) \cup (S^1 \times I)
$$
So, the outline for the proof goes like this:


*

*Write down set theoretic formulas for decomposing the domain $X$ into two parts $X = X_1 \cup X_2$, such that
$$X_1 = \theta^{-1}(E^2 \times 0)
$$
and
$$X_2 = \theta^{-1}(S^1 \times I)
$$

*Write down formulas for $\theta | X_1$ and $\theta | X_2$. These should be ordinary formulas which you can verify continuity of, using ordinary tools of calculus.

*To prove continuity of $\theta$ itself, apply the pasting lemma: verify that $X_1 \cap X_2$ is closed, and that the formulas for $\theta | X_1$ and $\theta | X_2$ agree on the intersection $X_1 \cap X_2$, and you are done.


Carrying out steps 1 and 2 requires good analytic geometry skills. I'll get you started by carrying out steps 1 and 2 for $X_1$, leaving you to try $X_2$ (which is harder).
The set $X_1$ is a frustum, obtained by starting with the solid circular cone having base $E^2 \times 0$ and apex $(0,0,2)$, and then intersecting that cone with the solid cylinder $E^2 \times I$. You can write it as
$$X_1 = \{(x,y,z)\quad \,|\,\quad x^2 + y^2 \le \left(1-\frac{z}{2}\right)^2 \quad\text{and}\quad  0 \le z \le 1 \}
$$
To get the formula for $\theta(x,y,z)$ when $(x,y,z) \in X_1$, take the ray from $(0,0,2)$ through $(x,y,z)$, and intersect that ray with $E^2 \times \{0\}$. You get
$$\theta(x,y,z) = (0,0,2) + \frac{2}{2-z}\bigl((x,y,z)-(0,0,2)\bigr) = \bigl(\frac{2x}{2-z},\frac{2y}{2-z},0\bigr)
$$
Since the plane $z=2$ is disjoint from the set $X_1$, this formula shows that $\theta | X_1$ is continuous. (You might also want to verify that this formula has image in $E^2 \times 0$ when $(x,y,z) \in X_1$).
Here, very briefly, are some portions of steps 1 and 2 of $X_2$. The set $X_2$ is the closure of the complement of frustrum $X_1$ inside the cylinder $E^2 \times I$, and so
$$X_2 = \{(x,y,z) \quad \,|\, \quad (1-\frac{z}{2})^2 \le x^2 + y^2 \le 1 \quad\text{and}\quad 0 \le z \le 1\}
$$
The formula for $\theta(x,y,z)$ will instead be obtained by taking the ray from $(0,0,2)$ through $(x,y,z)$ and intersecting with the cylindrical surface $S^1 \times I$.
Finally, you should be able to write down the set theoretic formula for $X_1 \cap X_2$ and verify that it is a closed set, and that the two parts of the formula for $\theta$ give the same outcome for $(x,y,z) \in X_1 \cap X_2$.
A: Regarding $\theta(\mathbf x)$ where $\mathbf x=(x,y,z)$ we have
$$
\theta(\mathbf x)=
\begin{cases}
\frac{1}{\sqrt{x^2+y^2}}(x,y,z-2)+
(0,0,2)
&\text{if}\quad \sqrt{x^2+y^2}>\frac{2-z}{2}\\
\quad\\
\frac{2}{2-z}(x,y,0)            &\text{otherwise}
\end{cases}
$$
if I am not mistaken.

These expressions are continuous since when
$$
\sqrt{x^2+y^2}=\frac{2-z}{2}
$$
we have
$$
\begin{align}
\frac{1}{\sqrt{x^2+y^2}}(x,y,z-2)+
(0,0,2)
&=
\frac{2}{2-z}(x,y,z-2)+
(0,0,2)\\
&=
\frac{2}{2-z}(x,y,0)
\end{align}
$$
and all the rest is just compositions, sums, and products of continuous functions.
