Nontrivial map from manifold to real projective space I am doing now old topology quals from Maryland University, and there is a following problem:
If $M$ is compact smooth connected m-manifold, show that there exists non null-homotopic continuous map from $M$ to $\mathbb{R}P^n$, assuming that $m=n$ and $n$ is odd.
How to solve this problem? Also, why odd $n$ is easier? There is an information that this is also true for even $n$.  
 A: First, suppose $M$ is not orientable.  Then $H^1(M;\mathbb{Z}/2)$ is nontrivial, and so there is a map $f:M\to K(\mathbb{Z}/2,1)=\mathbb{R}P^\infty$ which induces a nonzero map on $H^1(-;\mathbb{Z}/2)$.  Since $M$ is $n$-dimensional, $f$ is homotopic to a map $g:M\to\mathbb{R}P^n$ by cellular approximation.  This map $g$ is nonzero on $H^1(-;\mathbb{Z}/2)$, and in particular is not nullhomotopic.
Now suppose $M$ is orientable.  Collapsing the exterior of an open ball in $M$ to a point gives a map $f:M\to S^n$, which induces an isomorphism on $H^n(-;\mathbb{Z})$ (assuming $n>0$; for $n=0$ the result is not true).  Composing $f$ with the quotient map $p:S^n\to\mathbb{R}P^n$, we get a map $pf:M\to \mathbb{R}P^n$.
There are now two ways we can show $pf$ is not nullhomotopic, one of which requires you to assume $n$ is odd.  First, if $n$ is odd, we get this by a simple calculation on cohomology.  When $n$ is odd $\mathbb{R}P^n$ is orientable and $p$ induces multiplication by $2$ on $H^n(-;\mathbb{Z})$.  It follows that $pf$ induces multiplication by $2$ on $H^n(-;\mathbb{Z})$ and thus is not nullhomotopic.
Alternatively, we can note that since $p$ is a covering map, any nullhomotopy of $pf$ would lift to a homotopy from $f$ to a map whose image is contained in a single fiber of $p$.  Since $M$ is connected, the latter map must actually be constant, so this gives a nullhomotopy of $f$.  But $f$ is nontrivial on $H^n(-;\mathbb{Z})$ and so is not nullhomotopic, so $pf$ cannot be nullhomotopic either.
