# Any continuous map is homotopic to one assuming fixed values at finitely many points

Let $$X$$ and $$Y$$ be topological spaces. Assume $$X$$ is locally contractible and has no dense finite subset. Assume $$Y$$ is path-connected.

Given $$n$$ pairs of points $$(x_i, y_i)$$ where $$x_i\in X$$ and $$y_i\in Y$$ for $$1\leq i\leq n$$ and a continuous map $$f:X\to Y$$ can we find a continuous map $$g:X\to Y$$ homotopic to $$f$$ such that $$g(x_i)=y_i$$?

• Any self-homotopy equivalence of the Hawaiian earring $H$ has to preserve the origin $o$, so $X = Y = H, f = \operatorname{id}, n = 1, x_1 = o, y_1 \neq o$ is a counterexample., – Bertram Arnold Aug 17 at 10:29
• Corrected after the comment. – user145520 Aug 17 at 10:54

Let $$X$$ be the real line with a doubled origin and $$Y$$ be $$\Bbb R$$, and let $$f$$ be the projection map that collapses the two origins $$0^+$$ and $$0^-$$ to $$0$$. Then any map $$g: X \to Y$$ satisfies $$g(0^+) = g(0^-)$$ because $$\Bbb R$$ is Hausdorff. Therefore, $$f$$ is not homotopic to any map that sends these two points to distinct ones.
Your question is closely related to the inclusion $$\{x_1,\dots,x_n\} \subset X$$ having the homotopy extension property. In particular, if it is the inclusion of a neighborhood deformation retract, then such homotopies exist. In the example above, each point individually has a contractible neighborhood but the two origins together do not have a neighborhood that retracts back onto them.