It suffices to prove ?\Rightarrow?. Suppose that ? holds, and let \gamma \colon X \to Y be a regular map homotopic to f. We may assume that X,Y are Zariski closed subsets of \mathbb{R}^k,\mathbb{R}^l, respectively. Then there exists a Zariski open neighborhood \Omega \subseteq \mathbb{R}^k of X and a regular map \tilde \gamma \colon \Omega
\to \mathbb{R}^l with \tilde \gamma|_X = \gamma, see [bib2, p. 62]. By the Tietze extension theorem, there exists a continuous map \tilde f \colon \Omega
\to \mathbb{R}^l with \tilde f|_X = f. Now, let \rho \colon T \to Y be a \mathcal{C}^{\infty} tubular neighborhood of Y in \mathbb{R}^l, where T is an open neighborhood of Y in \mathbb{R}^l and \rho is a \mathcal{C}^{\infty} retraction. Choose an open neighborhood U \subseteq \Omega of X such that \tilde f(U) \subseteq T and \tilde \gamma(U) \subseteq T. By [bib32, p. 44, Theorem 2.2], we can also choose a \mathcal{C}^{\infty} map U \to T arbitrarily close to \tilde f|_U
\colon U \to T in the strong \mathcal{C}^0 topology; such a map is homotopic to \tilde f|_U \colon U \to T. Therefore, for the proof of ?, we may assume that the map \tilde f|_U
\colon U \to T is of class \mathcal{C}^{\infty}. Clearly, the maps \varphi, \psi
\colon U \to Y, defined by
\varphi(x) = \rho(\tilde \gamma(x)), \quad \psi(x) = \rho(\tilde f(x)) \quad
\text{for all } x \in U,
are of class \mathcal{C}^{\infty} and satisfy \varphi|_X=\gamma, \psi|_X=f. Shrinking U, the variety X is a continuous retract of U (X is locally contractible [bib2, Theorem 9.3.6], so it is a Euclidean neighborhood retract by Borsuk’s theorem [bib22, p. 537, Theorem E.3]). Consequently, the \mathcal{C}^{\infty} maps \varphi, \psi are homotopic, and hence there exists a \mathcal{C}^{\infty} homotopy \Phi \colon U \times [0,1] \to Y with \Phi_0 = \varphi and \Phi_1 = \psi [bib49a, Proposition 10.22]. Let U_0 \subseteq \mathbb{R}^k be an open subset whose closure \overline{U_0} is compact and contained in U.
Consider the canonical projection h \colon \mathbb{R}^k \times Y \to \mathbb{R}^k and the homotopy of its \mathcal{C}^{\infty} sections
F \colon U \to \mathbb{R}^k \times Y, \quad x \mapsto (x,\Phi(x,t)).
According to Lemma 4.1, h \colon \mathbb{R}^k \times Y \to \mathbb{R}^k is a malleable submersion. Hence, by Lemma 3.8, there exist a dominating spray (E,p,s) for h \colon \mathbb{R}^k \times Y \to
\mathbb{R}^k and a continuous map {\xi \colon U_0 \times [0,1] \to E} such that p \colon E = (\mathbb{R}^k \times Y) \times \mathbb{R}^n \to \mathbb{R}^k \times Y is the product vector bundle and \xi(x,t) = (F(x,0), \eta(x,t)), where the continuous map \eta \colon U_0 \times [0,1] \to \mathbb{R}^n satisfies
s(F(x,0), \eta(x,t)) = F(x,t) \quad \text{for all } (x,t) \in U_0 \times
[0,1].
In particular,
s(F(x,0), \eta(x,1)) = F(x,1) = (x, \psi(x)) \quad \text{for all } x \in
U_0.
By the Weierstrass approximation theorem, there exists a regular map \beta \colon \mathbb{R}^k \to \mathbb{R}^n such that the restriction \beta|_{U_0} is arbitrarily close to the \mathcal{C}^{\infty} map \eta_1 \colon U_0 \to \mathbb{R}^n, x \mapsto \eta(x,1) in the \mathcal{C}^0 topology. Then
\alpha \colon U \to \mathbb{R}^k \times Y, \quad x \mapsto s(F(x,0), \beta(x))
is a \mathcal{C}^{\infty} section of h \colon \mathbb{R}^k \times Y \to \mathbb{R}^k such that \alpha|_{U_0} is close in the \mathcal{C}^0 topology to the section
U_0 \to \mathbb{R}^k \times Y, \quad x \mapsto (x, \psi(x)).
We have \alpha(x) = (x, \theta(x)), where \theta \colon U \to Y is a \mathcal{C}^{\infty} map. Since F(x,0) = (x, \varphi(x)) and \varphi|_X = \gamma is a regular map, the restriction g \coloneqq \theta|_X \colon X \to Y is a regular map. By construction, g|_{X \cap U_0} is close to the continuous map \psi|_{X \cap U_0} = f|_{X \cap U_0}. The proof is complete since U_0 is chosen in an arbitrary way.