This is a rather stupid question, but I bumped into a wrong reasoning and I can't find the mistake.
Say you have a circle $\mathbb{S}^1$ in the real plane $\mathbb{R}^2$. Now, as $\mathbb{R}^2$ is contractible, there exists a homotopy $H : \mathbb{R}^2 \times [0, 1] \rightarrow \mathbb{R}^2$ between the identity map $\text{id}_{\mathbb{R}^2}$ and a constant map. We can moreover suppose that the image of the constant map is a point $p$ on the circle $\mathbb{S}^1$.
The restriction of $H$ to $\mathbb{S}^1 \times [0, 1]$ would then be continuous, as a composition of two continuous maps $H \circ \iota_{\mathbb{S}^1 \times [0,1]}$. Furthermore, if we note $\overline{H} = H \circ \iota_{\mathbb{S}^1 \times [0,1]}$, we have $\overline{H}(\cdot, 0) = \text{id}_{\mathbb{S}^1}$ and $\overline{H}(\cdot, 1) = p$ (a constant map on $\mathbb{S}^1$). The map $\overline{H}$ is hence a homotopy between the identity map and a constant map on $\mathbb{S}^1$.
This is obviously wrong, since $\mathbb{S}^1$ is not contractible, and therefore such a homotopy cannot exist. Where is the error, and perhaps more generally, when is a restriction of a homotopy indeed a homotopy?
This is not obviously wrong - it is obviously true! It is an exercise from Hatcher, chapter zero to see that a space is contractible iff. every map into it is nullhomotopic. So of course the subspace inclusion map $S^1\to\Bbb R^2$ is nullhomotopic… that says nothing about contractibility which is asking for a nullhomotopy of the identity map $S^1\to S^1$; codomains matter.
Put differently, the restriction of a homotopy is always a homotopy (for the exact reason that subspace inclusion is continuous; nothing special about homotopies here). Similarly the corestriction of a homotopy is always a homotopy; however you must check the corestriction actually exists. Namely, you must check the map $S^1\times I\to\Bbb R^2$ has image contained in $S^1$… which it doesn’t.