Let $M$ be a connected, compact, oriented manifold of dimension $n<7$. If any two maps $M \to M$ having equal degrees are homotopic, must $M$ be diffeomorphic to the $n$sphere?

$\newcommand{\ZZ}{\mathbb{Z}}$$\newcommand{\CC}{\mathbb{C}}$A simple counterexample is given by $M = \CC P^3$. Recall first that the cohomology ring of $\CC P^3$ is a truncated polynomial algebra: $$ H^\ast(\CC P^3;\ZZ) = \ZZ[x]/(x^4) $$ with $x \in H^2(\CC P^3;\ZZ)$. The set of homotopy classes of selfmaps of $\CC P^3$ is $$ [\CC P^3,\CC P^3] = [\CC P^3,\CC P^\infty] = H^2(\CC P^3;\ZZ) = \ZZ $$ where a selfmap $f$ of $\CC P^3$ is taken to the unique integer $k\in\ZZ$ such that $f^\ast x = kx$. The first isomorphism above, $[\CC P^3,\CC P^3] = [\CC P^3,\CC P^\infty]$, follows by cellular approximation from:
Consequently, a selfmap $f:\CC P^3 \to \CC P^3$ corresponding to the integer $k \in \ZZ$ has degree $k^3$: we have $f^\ast x = kx$, therefore $$ f^\ast(x^3) = (f^\ast x)^3 = (kx)^3 = k^3 x^3 $$ Since $k\mapsto k^3$ is an injective map $\ZZ\to\ZZ$, any two selfmaps of $\CC P^3$ which have the same degree are homotopic. On the other hand, $\CC P^3$ is not diffeomorphic, or even homotopy equivalent, to $S^6$. Further example added later: $\newcommand{\To}{\longrightarrow}$$\newcommand{\Hom}{\operatorname{Hom}}$$\newcommand{\QQ}{\mathbb{Q}}$$\newcommand{\RR}{\mathbb{R}}$Another counterexample is given by any real projective space $\RR P^n$ of odd dimension $n>1$. So we get the counterexamples $\RR P^3$ and $\RR P^5$ in dimensions less than seven. I have failed to find any reference with a proof that two selfmaps of $\RR P^n$ which have the same degree are homotopic, although this result is stated without proof as theorem 2.1 in this article (McGibbon, Selfmaps of projective spaces, Transactions of the A.M.S. 271 (1), 1982, pages 325346). For completeness, I will give a proof below. The proof is more homotopy theoretical than for the case of $\CC P^3$ above, yet also uses fairly standard techniques. [The rest of this answer is rather long, and you may ignore it if you are not interested in the proof for $\RR P^n$.] Proof that two selfmaps of $\RR P^n$ (with $n>1$ odd) are homotopic if they have the same degree Assume that $n$ is an odd integer with $n>1$. I will actually prove the stronger result that two basepointpreserving selfmaps of $\RR P^n$ which have the same degree are homotopic via a basepointpreserving homotopy. More precisely, I will prove that the map which takes (the pointed homotopy class of) a selfmap to its degree $$ \deg : [\RR P^n,\RR P^n]_\ast \To \ZZ $$ is a bijection. Let us start with a lemma which will be useful later on. Lemma: A map $f:\RR P^n \to \RR P^n$ (with $n>1$) has even degree if and only if $f$ induces the trivial map on fundamental groups. Proof: This proof involves some cohomological computations similar to the ones done earlier for $\CC P^3$. Note that $H^\ast(\RR P^n;\ZZ/2) = \ZZ/2[x]/(x^{n+1})$ where $x$ is in degree $1$. Since $\pi_1(\RR P^n)=\ZZ/2$, a selfmap $f$ of $\RR P^n$ induces the trivial homomorphism on $\pi_1$ if and only if it induces the trivial homomorphism on $H^1(;\ZZ/2)$, i.e. if and only if $f^\ast x = 0$. Letting $f^\ast x = k x$ with $k\in\ZZ/2$, then $f^\ast(x^n) = k^n x^n = k x^n$, so $k = \deg f \mod 2$. The result follows. ■ A cofibre sequence involving $\RR P^n$. Our starting point is the following description of $\RR P^n$. The space $\RR P^n$ is obtained by attaching a $n$cell to $\RR P^{n1}$ whose attaching map is the standard covering map $\pi : S^{n1} \to \RR P^{n1}$. In short, $\RR P^n$ is the homotopy cofibre of the map $\pi$. The associated homotopy cofibre sequence — extended to the right by one term — is: $$ S^{n1} \overset{\pi}{\To} \RR P^{n1} \overset{i}{\To} \RR P^n \overset{q}{\To} S^n $$ Here, the first map $\pi$ is the standard quotient map, the second map $i$ is the inclusion, and the third map $q$ collapses $\RR P^{n1}$ to a point. The associated exact sequence in homotopy. Applying the functor $[,\RR P^n]_\ast$ to the above cofibre sequence produces an exact sequence: $$ [S^n,\RR P^n]_\ast \overset{q^\ast}{\To} [\RR P^n,\RR P^n]_\ast \overset{i^\ast}{\To} [\RR P^{n1},\RR P^n]_\ast \overset{\pi^\ast}{\To} [S^{n1},\RR P^n]_\ast $$ This is an exact sequence of pointed sets. Moreover, the leftmost term is a group, and the sequence verifies a stronger equivariant exactness property at the term $[\RR P^n,\RR P^n]_\ast$ which will be explained and used later. Calculation of the terms of the exact sequence. First, let us calculate all terms of the sequence other than $[\RR P^n,\RR P^n]_\ast$:
Summarizing, the previous exact sequence of pointed sets is $$ \ZZ \overset{q^\ast}{\To} [\RR P^n,\RR P^n]_\ast \overset{i^\ast}{\To} \ZZ/2 \overset{\pi^\ast}{\To} 0 $$ In particular, $i^\ast$ is a surjective function. Description of the arrow $i^\ast$ of the exact sequence. The next step is to identify the function $i^\ast$ appearing in the exact sequence. Consider the following isomorphisms characterizing the target of $i^\ast$: $$ [\RR P^{n1},\RR P^n]_\ast = \widetilde{H}^1(\RR P^{n1};\ZZ/2) = \Hom\bigl(\pi_1(\RR P^{n1}),\ZZ/2\bigr) = \Hom\bigl(\pi_1(\RR P^{n1}),\pi_1(\RR P^n)\bigr) $$ Recall that the inclusion $i:\RR P^{n1}\to \RR P^n$ induces an isomorphism on $\pi_1$. Therefore, the function $$ i^\ast : [\RR P^n,\RR P^n]_\ast \To \Hom\bigl(\pi_1(\RR P^{n1}),\pi_1(\RR P^n)\bigr) = \ZZ/2 $$ takes $f:\RR P^n \to \RR P^n$ to $0\in\ZZ/2$ if and only if $f$ induces the trivial homomorphism on fundamental groups. The lemma at the beginning of this proof now implies that $i^\ast$ takes a map $f$ to its degree mod $2$, $\deg_2 f$. In conclusion, the exact sequence becomes: $$ \ZZ = [S^n,\RR P^n]_\ast \overset{q^\ast}{\To} [\RR P^n,\RR P^n]_\ast \overset{\deg_2}{\To} \ZZ/2 $$ where the second arrow $\deg_2$ returns the degree mod $2$ of a selfmap of $\RR P^n$. We know from before that $\deg_2 = i^\ast$ is surjective. Equivariant exactness property of the exact sequence. At this point, we require the special equivariant exactness property of the long exact sequence in homotopy associated to a cofibre sequence. In this case, it states:
The action of $\alpha \in [S^n,\RR P^n]_\ast$ takes $f \in [\RR P^n,\RR P^n]_\ast$ to: $$ \alpha\cdot f : \RR P^n \overset{\sigma}{\To} S^n \vee \RR P^n \overset{\alpha+f}{\To} \RR P^n $$ where the map $\sigma$ simply "pinches a small spherical bubble off of $\RR P^n$". Note that $\deg(\alpha\cdot f) = \deg\alpha + \deg f$. Conclusion of the proof. We are now ready to finish the proof. First we will show the injectivity of the degree function. Assume that $f$ and $g$ are pointed selfmaps of $\RR P^n$ which have the same degree. Then their degrees mod $2$ also coincide and, by the exactness property above, there exists $\alpha$ such that $\alpha\cdot f = g$. But $$ \deg f = \deg g = \deg(\alpha\cdot f) = \deg\alpha + \deg f $$ so that $\deg\alpha = 0$. It follows that $\alpha = 0$ in $\pi_n(\RR P^n)$, since elements in $\pi_n(\RR P^n) = \pi_n(S^n)$ are determined by their degree (here we require that $n$ is odd). Thus $g = \alpha\cdot f = f$ in $[\RR P^n,\RR P^n]_\ast$. Finally, we show that any integer is the degree of some map $\RR P^n \to \RR P^n$. Recall that the function $\deg_2 : [\RR P^n,\RR P^n]_\ast \to \ZZ/2$ taking a map to its degree mod $2$ is surjective. In other words, there are selfmaps of $\RR P^n$ with even and odd degrees. Since $\deg(\alpha\cdot f) = \deg\alpha + \deg f$, the desired conclusion follows by observing that any even integer is the degree of some map $\alpha : S^n \to \RR P^n$ — which holds because the covering map $S^n \to \RR P^n$ has degree $2$ and induces an isomorphism on $\pi_n$. 


To complete @RyanBudney's suggestion (and @Misha's comment), there are 3manifolds in the snappea census which have trivial isometry group, so in particular have no nontrivial degree 1 selfmaps, and which have trivial first betti number. If the map is degree $>0$, then this follows from Gromov's proof of Mostow rigidity (using the Gromov norm, the degree must $=\pm 1$, and the map is homotopic to an isometry). If a degree zero map from a 3manifold to itself is homotopically nontrivial, then it must surject the fundamental group of some covering space. If this covering space is finiteindex, then since the group is cofinitely Hopfian, this map must induce an isomorphism on fundamental group, and thus must be degree $\pm 1$, a contradiction. Thus, the image group must be infinite index. These groups have positive betti number, a contradiction. 

