Show that $f$ is homotopic to a constant function 
Let $X$ be a compact manifold with $\dim(X)<n$ and $f:X \rightarrow S^n$ be a smooth function, show that $f$ is homotopic to a constant function.

I try to use the fact that $S^n$ is simply connected and and trying to proceed by contradiction but I am not sure how to move through the homotopy between $X$ and $S^n$ maybe i can using something like the sards theorem.
Any hint or help i will be very grateful
 A: By the Cellular approximation theorem we can deform $f$ to a cellular function. This map can't be surjective, because then it will be an "identification".
But $S^n\setminus \{pt \}\cong \Bbb R^n$.

Edit
After the comment by @Andreas Cap, this can certainly be improved.
A cellular map maps $n$-skeleta into $n$-skeleta.
The $n$-sphere has a decomposition as a $0$-cell and an $n$-cell.  But the $m$-skeleton of $S^n$ consists in just the base point. Thus the map is constant.
A: By Sard's Lemma, the set of regular values of $f$ is dense in $S^n$.
Since $\dim X < \dim \Bbb S^n$, no value $f(x)$ with $x\in X$ is regular, and hence, $\Bbb S^n \setminus f(X)$ is dense.
It is in particular non-empty.
Without loss of generality, assume that the north pole $N$ is not in $f(X)$.
Let $\varphi \colon \Bbb S^n\setminus \{N\} \to \Bbb R^n$ be the stereographic projection from the north pole.
The map
$$
H(t,x) = \varphi^{-1}\left(t \varphi( f(x))\right)
$$
is then an homotopy from the constant map $H(0,\cdot)\equiv S$ (the south pole) and $H(1,\cdot)=f$.
A: We can assume $X$ is a topological manifold without boundary.  Then given $n$, there exists a smooth map $f:X \to S^n$ if and only if $f$ satisfies the homotopy equality $f_*([X]) = [S^n]$.  Since $[S^n] = 0 \in H_n(S^n)$, this equality is equivalent to the homotopy equality $f_*([X]) = 0 \in H_n(S^n)$.  The latter, in turn, is equivalent to the surjectivity of $f_*:H_n(X) \to H_n(S^n)$.
Suppose now that $n > \dim X$.  Then $H_n(X) = 0$, so $f_*([X]) = 0 \in H_n(S^n)$, i.e., $f$ is homotopic to a constant.
Side note:  I am omitting the proof that if $f$ is homotopic to a constant, then $f_*([X]) = 0 \in H_n(S^n)$.  This is a well-known fact.  The proof is easy using the excision theorem and the fact that the homotopy equivalence class of $[X] \in H_n(X)$ is uniquely determined by $[X] \in H_n(X,X - f^{-1}(0))$.  I'll leave the details to you.
