A map $I^n\to I^n$; Dieter Puppe's proof of the homotopy excision In his book Algebraic Topology, tom Dieck (p.149, lemma 6.9.1) seeks to define a continuous map $h\colon I^n\to I^n$ in the following way: he sets $x = (1/4,\dots, 1/4)$, $P(y) = y\cap \partial[0,1/2]^n$ and $Q(y) = y\cap \partial I^n$, where $y$ is (any) ray starting at $x$. He them claim that $h$ maps a line segment from $P(y)$ to $Q(y)$ to $Q(y)$, and affinely maps a line segment from $x$ to $P(y)$ to $x$ to $Q(y)$ (for every ray $y$).
In course of the proof of the lemma in question, he claims that that $h(z)_i > 1/2$ implies $h(z)_i = 1/4 + t(z_i - 1/4)$ for some $t \geq 1$.
However, I dont' see why such a continuous map in question exists. I'm seeing a formula, or at least some proof that a map exists. The way I see it, is that we need to consider the divison of $I^n$ into the union of two closed susbsets $A = [0,1/2]^n$ and $B = (I^n\setminus [0,1/2]^n)\cup \partial [0,1/2]^n$. On $B$, $h$ would maps $z$ to $P(y_{x,z})$ where $y_{x,z}$ is the ray at $x$ through $z$. But why would such a map be continuous? On $A$, $h$ would map $z \in [0,1/2]^n$ to $(1/4 + t_1(z_1 - 1/4), \dots, (1/4 + t_n(z_n - 1/4))$ for some $t_1,\dots, t_n \geq 1$. However, it is clear to some that such $t_1,\dots,t_n$ depend on $z_1,\dots,z_n$, respectively. One can, of course, compute them in an ad-hoc way: given $z \in [0,1/2]^n$, one first finds an intersection $C$ of $y_{x,z}$ and $\partial [0,1/2]^n$, then the intersection $D$ of $y_{x,z}$ and $\partial I^n$, then computes the line passing through $C$ and $D$, etc, but I don't see why it's possible to prove continuity this way.
 A: 
On $B$, $h$ would maps $z$ to $P(y_{x,z})$ where $y_{x,z}$ is the ray at $x$ through $z$. But why would such a map be continuous?

One way is to use multivalued analysis, in particular the concept of hemicontinuity. Fix $v\in\mathbb{R}^n$ and consider
$$F_1:\mathbb{R}^n\backslash\{v\}\to\mathcal{P}(\mathbb{R}^n)$$
$$F_1(x)=\partial I^n$$
Since it is a constant map, then it is lower hemicontinuous. On the other hand let
$$F_2:\mathbb{R^n}\backslash\{v\}\to\mathcal{P}(\mathbb{R}^n)$$
$$F_2(x)=\text{half line starting at }v\text{ through }x$$
This map is also lower hemicontinuous and so is
$$F_3:\mathbb{R^n}\backslash\{v\}\to\mathcal{P}(\mathbb{R}^n)$$
$$F_3(x)=F_1(x)\cap F_2(x)$$
map. Now if we choose $v$ inside $I^n$ cube, then $F_3(x)$ is a singleton at any $x\neq v$. And in that case our $F_3$ is actually a singlevalued function. And for multivalued but singlevalued functions lower hemicontinuity is equivalent to continuity. Alternatively we can use Michael's selection theorem here.
And so the piece of our function defined on $B$, responsible for projecting a point onto boundary through a half line is continuous.
This probably can be solved by some ad-hoc method, without referring to hemicontinuity, but that approach is more elegant in my opinion, and it generalizes well to other geometric structures

On $A$, $h$ would map $z \in [0,1/2]^n$ to $(1/4 + t_1(z_1 - 1/4), \dots, (1/4 + t_n(z_n - 1/4))$ for some $t_1,\dots, t_n \geq 1$.

So this is a convoluted way of saying that in reality $h$ on $A$ is a not-so-simple rescaling which I will now construct in a more direct way. It will also become clear why it is continuous, and how exactly those $t_i$ are constructed.
If $v=(1/4,\ldots,1/4)$ then as we've already established in the previous part that the projection $Q(x)$, $x\neq v$ of the half line connecting $v$ to $x$ onto $\partial [0,1/2]^n$ is continuous. Analogously the $P(x)$ projection onto $\partial I^n$ is continuous. In that case define
$$T(x)=\frac{\lVert x-P(x)\lVert}{\lVert v-P(x)\rVert}$$
which is well defined and continuous whenever $x\neq v$. Then define:
$$h(x)=\begin{cases}
T(x)\cdot v+(1-T(x))\cdot Q(x) &\text{if }x\neq v \\
v &\text{otherwise}
\end{cases}$$
I leave as an exercise that it is continuous as well.
How does it work? If we take the interval connecting $v$ to $P(x)$ then every element on the interval can be written as $t\cdot v+(1-t)\cdot P(x)$ for some  unique $t\in[0,1]$. And so given $x$ in the interval our $T(x)$ is precisely the $t$ from the formula above. I just wrote the formula explicitly (which also shows that it is continuous). And now when we have that $t$, we want to apply it to $[v,Q(x)]$ interval, so that our $x$ gets mapped in the same proportion.
Note that when $P(x)=Q(x)$ (e.g. when all $x_i<1/4$) then $h(x)=x$.
