Is homotopy of smooth maps $M \to \mathbb{S}^n$ equivalent to smooth homotopy? I'm trying to solve the following exercise from Milnor's Topology from the Differentiable Viewpoint
Let $M$ be a compact smooth manifold, show that every continuous map $M \to \mathbb{S}^n$ can be uniformly approximated by a smooth map. If  two smooth maps are continuously homotopic, show that they are smoothly homotopic.
I solved the first part approximating every coordinate thanks to Stone-Weierstrass' Theorem and normalizing. I think it should work. Then I tried to use the first part to solve the second one (about smooth homotopy), but I'm not able to understand how I should use approximation to change a continuous map to a smooth one. How could I solve this problem?
 A: The intuitive idea is to just apply a suitable approximation theorem a second time, namely to the homotopy $h \colon M \times I \to \mathbb{S}^n$. But you have to be a bit more careful because you want $h_0$ and $h_1$ to not change. A reference for the fact that you can do this is Theorem 6.21 of Lee's Intro to Smooth Manifolds. I'll more or less recite it.
Theorem. Let $M$ be a smooth manifold with boundary and $F \colon M \to \mathbb{R}^k$ be a continuous function such that $F|_{\partial M}$ is smooth. Then $F$ can be uniformly approximated by a smooth function $\widetilde{F} \colon M \to \mathbb{R}^k$ in such a way that $\widetilde{F}|_{\partial M} = F|_{\partial M}$.
The rough idea is as follows. First, extend the smooth function $F|_{\partial M}$ to a smooth function $G_1 \colon M \to \mathbb{R}^k$. Now let $U = \{x \in M : |G(x) - F(x)| < \varepsilon\}$, which is an open subset containing $\partial M$. Now uniformly approximate $F$ on the interior to some $G_2$ using e.g. Stone--Weierstrass, and then use a partition-of-unity argument to combine $G_1$ on $U$ with $G_2$ on $M \setminus U$ so as to form a global function $\widetilde{F}$ which both approximates $F$ everywhere and still stays fixed at the boundary.
A: I think I found the solution in the case $\partial M = \emptyset$. If someone could check it I'll be grateful.
Let $f,g : M \times \to \mathbb{S}^n$ be two smooth maps and let $H : M \times [0,1] \to \mathbb{S}^n$ be a continuous homotopy between $f,g$. Since $\partial M = \emptyset$, we can say that $ M \times [0,1]$ is a compact smooth manifold. Hence exists  $\widetilde{H} : M \times [0,1] \to \mathbb{S}^n$ such that $\lVert H-\widetilde{H}\rVert < 2$. Now using $$\frac{t\widetilde{H}(x,0) - (1-t)f(x)}{\lVert t\widetilde{H}(x,0) - (1-t)f(x) \rVert}$$ we conclude that $f$ is smoothly homotopic to $\widetilde{H}(\cdot,0)$ and in the same way we can show that $g$ is smoothly homotopic to $\widetilde{H}(\cdot,1)$. Since being smoothly homotopic is an equivalence relation, $f$ and $g$ are smoothly homotopic.
