Solution (source code)

= Solution

The absence of $n$-simplices implies absence of every higher-dimensional simplex, since any such simplex would have an $n$-face. Therefore $X$ has a CW structure of dimension at most $n-1$. Give $S^n$ its CW structure with one zero-cell and one $n$-cell. The <cellular approximation theorem> states that any map of CW complexes is homotopic to a cellular map, which sends each source skeleton into the corresponding target skeleton. For $n\geq1$, all target skeletons below dimension $n$ are the single zero-cell. The approximating map therefore sends all of $X$ there. Hence \b[every given map is null-homotopic]. This argument works for an infinite simplicial complex too; it does not require a finite subdivision or a finite collection of image simplices.