A couple of questions. $X$ is a compact manifold, $Z\subset Y$ is a closed submanifold, then
(i) If $Y$ is contractible (i.e. $id_Y$ is homotopic to a constant map), then any map $f: X\rightarrow Y$ is homotopic to the constant map. May I know why this is true?
$X\xrightarrow{f}Y\xrightarrow{id_Y}Y$ and $id_Y\sim \{y\}$, $\{y\}$ being a constant map.
(ii) No compact manifold is contractible. The reason given is let $Z$ be a single point and let $f:X\rightarrow X$ be an identity map. Then since $X$ is contractible, $f$ is homotopic to a constant map and hence $I_2(f,Z) = 0$. But $\#(f(X)\cap Z) = \#Z = 1$ and hence a contradiction.
I know that if $g:X\rightarrow Y$ is homotopic to a constant map, then $I_2(g,Z) = 0$. So, how does $f\sim \{y\}\implies g\sim \{y\}$?. Thanks!
For (i) this is actually a consequence of the following general result.
For (ii) the result you're trying to prove is incorrect as there are plenty compact manifolds that are contractible. For example any convex subset of $\mathbb{R}^n$ is contractible via a straight line homotopy. It's easy to see then that $[0,1]$ is a compact manifold that is contractible.