Show that there is a polynomial function $f$ of degree $n$ such that
$f'(x)=0$ for precisely $n-1$ numbers;
$f'(x)=0$ for exactly $k$ numbers $x$ if $n-k$ is odd.
For part 1: I was thinking $(x-a_0)x^n+(x-a_1)x^n-1$ but not sure how to show that.
For part 2: I was thinking $ (x-k)^n-k$.
Hint for part 1: $f'$ is a polynomial of degree $n-1$, so it has at most $n-1$ distinct real roots, so all you need to do is choose a suitable polynomial $f'$ with exactly $n-1$ distinct real roots (e.g. a product of distinct linear factors $(x - a_i)$) and then take the antiderivative to obtain $f$.