Homotopy groups of Lie groups I asked it also there, and I still don't know the answer, so I try again.
I would like to know a closed manifold (possibly of low dimension) such that $\pi_2(\textrm{Diff}(M))\neq 0$.
Homotopy groups of Lie groups I asked it also there, and I still don't know the answer, so I try again.
I would like to know a closed manifold (possibly of low dimension) such that $\pi_2(\textrm{Diff}(M))\neq 0$.
$\newcommand{\Diff}{\mathrm{Diff}}$Probably the simplest such manifold is $S^1 \times S^2$, whose diffeomorphism group has the homotopy type of $O(2) \times O(3) \times \Omega SO(3)$. This has $\pi_2$ equal to $\pi_2\Omega SO(3)=\pi_3 SO(3) = {\mathbb Z}$. The $\Omega SO(3)$ term is realized by rotating the $S^2$ slices of $S^1\times S^2$ by an element of $SO(3)$ that varies as one goes around the $S^1$ factor of $S^1 \times S^2$. This calculation was originally done in a paper of mine:
An updated version of this paper is posted on my webpage.
Added later:
In higher dimensions, spheres provide interesting examples. By an elementary argument there is a homotopy equivalence $\Diff(S^n) \simeq O(n+1) \times \Diff_\partial(D^n)$ for all $n$, where the subscript $\partial$ denotes diffeomorphisms that restrict to the identity on the boundary of $D^n$. The question is whether $\Diff_\partial(D^n)$ is contractible. The status of this is: true for $n\le3$, unknown for $n=4$, and false for each $n\ge 5$. The noncontractibility can be deduced from the sequence $$\cdots\ \to \pi_2 \Diff_\partial(D^{n-2})\to \pi_1 \Diff_\partial(D^{n-1})\to \pi_0 \Diff_\partial(D^n) = \Theta_{n+1}$$ where $\Theta_{n+1}$ is the group of exotic (n+1)-spheres and the equality $\pi_0 \Diff_\partial(D^n) = \Theta_{n+1}$ is assuming $n\ge 5$. Usually $\pi_0 \Diff_\partial(D^n)$ is nonzero since exotic spheres exist in most dimensions greater than $6$, and in the rare dimensions in which they don't exist one can appeal to known results about how far some elements of $\Theta_{n+1}$ pull back in the sequence above. For example, Cerf's pseudoisotopy theorem says the map from $\pi_1 \Diff_\partial(D^{n-1})$ to $ \pi_0 \Diff_\partial(D^n)$ is surjective for all $n\ge 6$, so in particular $\pi_1 \Diff_\partial(D^5)$ is nonzero since it maps onto $\Theta_7={\mathbb Z}/28$. A paper of Crowley and Schick posted on the arXiv last month shows there is a nontrivial element of $\Theta_{8k+2}$ that pulls all the way back to $\pi_{8k-6} \Diff_\partial (D^7)$, hence $\Diff_\partial(D^n)$ has infinitely many nontrivial homotopy groups for all $n\ge 7$.
Since the groups $\Theta_{n+1}$ are finite (apart perhaps from the unknown $\Theta_4$), these constructions don't give nontrivial rational homotopy groups of $\Diff_\partial(D^n)$, but there is another construction that does, coming from algebraic K-theory. Using Waldhausen's big machine, Farrell and Hsiang in 1978 computed $\pi_i \Diff_\partial (D^n) \otimes{\mathbb Q}$ in a stable range $n\gg i$ to be ${\mathbb Q}$ for $i\equiv 3$ mod $4$ and $n$ odd, and $0$ otherwise. (This is the result mentioned in Vitali Kapovitch's answer.)
$\newcommand{\Diff}{\mathrm{Diff}}$Regarding the question about nontrivial $\pi_k(\Diff(M))$ for $k>2$ there are plenty of such examples too. For example, Farrell and Hsiang in On the rational homotopy groups of the diffeomorphism groups of discs, spheres and aspherical manifolds computed the rational homotopy groups of $\Diff(S^n)$ in the stability range ($i\lt n/6-7$), which in particular gives that in the stability range $\pi_{4i-1}(\Diff(S^n))\otimes \mathbb Q\ne 0$. They have some other computations there too. Those are hard results however and if you are not interested in computing the homotopy groups exactly and only want to prove that they are not trivial then much more elementary considerations are sufficient.
For example it's well known that for any odd $n$ the space $\mathrm{Aut}(S^{n})$ (the identity component of space of self homotopy equivalences of $S^n$) is rationally equivalent to $S^{n}$ and moreover the obvious map $SO(n+1)\to \mathrm{Aut}(S^n)$ is an epimorphism on $\pi_n \otimes \mathbb Q$. Since the map $SO(n+1)\to \mathrm{Aut}(S^n)$ factors through $SO(n+1)\to \Diff(S^n)\to \mathrm{Aut}(S^n)$ it follows that $SO(n+1)\to \Diff(S^n)$ is not zero on $\pi_n\otimes \mathbb Q$. This gives you lots of examples with nontrivial odd $\pi_i(\Diff(M))$. If you want even ones too then one can use the same trick as in Allen Hatcher's example.
Pick an element in $\pi_n(SO(n+1))\otimes \mathbb Q$ which maps to the generator of $\pi_n(S^n)\otimes\mathbb Q$ under the evaluation map and let $\alpha: S^{n-1}\to \Omega SO(n+1)$ be the corresponding spheroid in $\pi_{n-1}(\Omega SO(n+1))\cong \pi_n(SO(n+1))$ . This gives you a map $\Phi: S^{n-1}\times S^n\times S^1\to S^n\times S^1$ given by $\Phi(x,y,t)=(\alpha(x)(t)(y),t)$. By construction, this is an (n-1)-spheroid in $\Diff(S^n\times S^1)$. And it's clearly nontrivial because of the action of $\Phi$ on the cohomology. Therefore, $\pi_{n-1}(\Diff(S^1\times S^n))\otimes \mathbb Q\ne 0$ for any odd $n>1$.
$\newcommand{\Diff}{\mathrm{Diff}}$The previous examples have $\pi_2 \Diff(M)$ non-trivial, but finitely generated.
Here is an example of a manifold $M$ where $\pi_2 \Diff(M)$ is not finitely generated.
The manifold is $S^1 \times D^5$, and $\Diff(M)$ denotes the group of diffeomorphisms that acts trivially on the boundary. David Gabai and I proved this in the last year, in Knotted 3-balls in $S^4$, arXiv:1912.09029
In general we can show that $\pi_{n-3} \Diff(S^1 \times D^n)$ is not finitely generated, for all $n \geq 3$. We construct a non-trivial family $S^{n-3} \to \Diff(B)$ where $B$ is what we call a `barbell manifold'. This manifold is a boundary connect-sum of two copies of $S^{n-1} \times D^2$. We then embed the barbells in $S^1 \times D^n$, and extend the diffeomorphisms.
The map $\pi_{n-3} \Diff(S^1 \times D^n) \to \pi_{n-3} \mathrm{Emb}(D^n, S^1 \times D^n)$ detects our diffeomorphisms, and one can further descend via a Cerf `scanning' type construction to detect these elements in the homotopy-group $\pi_{2n-4} \mathrm{Emb}(I, S^1 \times D^n)$, which rationally looks somewhat like a two-variable Laurent polynomial ring.
If you want the manifold to be closed, I believe $\pi_{n-3} \Diff(S^1 \times S^n)$ will also not be finitely-generated. The $n=3$ case appears in the above paper, and the $n>3$ case will be in a follow-up.