A map $I^n\to I^n$; Dieter Puppe's proof of the homotopy excision
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$.