Let $a,b \in \mathbb{R}$ with $a < b$ and let $f : [a,b] \rightarrow \mathbb{R}$ be a continuous function which is not identically 0. Suppose for some $n \in \mathbb{N}$ that for all $k \in \{0, ..., n\}$ that
$$\int_a^b t^kf(t)dt = 0$$
We want to show that there are $n+1$ points where $f$ changes sign.
So my first inclination for this problem is that the statement is heavily suggestive of induction on $n$. As such what I want to show is that if $\int_a^b f(t)dt = 0$ and $\int_a^b tf(t)dt = 0$ then $f$ changes sign at least twice - preferably in a way that lends itself to being mimicked in the general case. So I observed that we already know that it changes sign at least once - as $f$ is not identically zero it could not otherwise be the case that $\int_a^b f(t)dt = 0$. So then I thought perhaps to suppose for contradiction that $f$ changes sign exactly once. From here I am not sure where to go.