A while ago I wrote a blogpost with this problem, and I fakesolved it! So here’s my redeeming attempt (and thanks to Zhao Yu for pointing it out to me).
Let $f:\mathbb R \to \mathbb R$ be an infinitely differentiable function. Show that if each point has a derivative that is 0, then $f$ is a polynomial.
This problem was given in the context of applications of the “Bear Cat theorem”, which says something like:
For any infinite sequence of closed sets $\{C_n\}_{n\in \mathbb N}$ whose union is $\mathbb R$, one of them must contain an interval.
So, along the lines of using this theorem, a natural starting point is to consider the set
$$E_n = \{x: f^{(n)}(x) = f^{(n+1)}(x) = f^{(n+2)}(x) = \cdots = 0 \}$$
which is closed (since the preimage of a continuous function is closed, and arbitrary intersections of closed sets are closed), then $E_n \uparrow \mathbb R$ (read: $E_n$ forms a chain of increasing sets that union to $\mathbb R$).
So one such $E_n$ contains an interval. Does this mean that $f$ is a polynomial on this interval? Yes, because we can apply the fundamental theorem of calculus: since $$f^{(n-1)}(x) = \int_{x_0}^x f^{(n)}(x) dx$$ if we have $f^{(n)} = 0$ on an entire closed interval $[a,b]$, then $f^{(n-1)}$ is constant on this interval, and $f^{(n-2)}$ is a linear function and so on to get that $f$ is a polynomial of degree at most $(n-1)$.
But that’s certainly not enough to finish the problem - an interval is much smaller than all of $\mathbb R$. But one way that we get further is to note that “such intervals are dense in $\mathbb R$”, because we can pick any interval $[c,d]$ and run our argument on $E_n \cap [c,d] \uparrow [c,d]$ to get an interval that is inside $[c,d]$. Thus we have shown that
Everywhere, there are chunks where $f$ is a polynomial.
This motivates considering the maximal such set:
$$G = \{x: \text{$f$ is a polynomial on some neighborhood of $x$}\}$$
where $G$ can be thought of as the “good” set, and it’s not hard to see that $G = \bigcup_{n=0}^\infty \mathrm{int}(E_n)$. The nice thing is that on each “connected component” of $G$, $f$ must be the same polynomial (which boils down to the usual compactness argument).
Here’s where I fakesolved it previously - it’s tempting to think of an open and dense $G$ as being a sequence of adjacent open intervals, and one notes that on adjacent open intervals, the polynomials must match (because each continuous derivative “propagates” to the endpoint). However, there could very well be complicated things like $$(\tfrac 1 2, 1), (\tfrac 1 3, \tfrac 1 2), (\tfrac 1 4, \tfrac 1 3), \cdots$$ that don’t allow us to “propagate” the polynomial across 0, for instance.
So the missing piece here is to do the “propagation” argument “all at once”. It will be useful to think about the complement set $B$ of “bad” points, which are necessarily the endpoints of “good” open intervals. One thing we know is that on a good interval that fits a degree $k$ polynomial, the endpoints vanishes past the $(k-1)$-th derivative. In the contrapositive, the polynomial that connects two bad points must vanish to at most as many derivatives as either endpoint.
So the genius move is now to consider a relative version of Bear Cat but just on the bad points - since $E_n \cap B \uparrow B$, one of them must contain “an interval’s worth of $B$” (i.e. non-empty $B\cap (e,f)$). However, all the bad points vanish at the $n$-th derivative, which means that the good intervals between them also vanish at the $n$-th derivative, so the entire interval $(e,f)$ is in $E_n$. But this means that the entire interval is good! So $B$ is in fact empty, and we are done.