Is this proof correct?
The problem is the following.
Let $n$ be a natural number. Suppose that the function $f:\mathbb{R}\to\mathbb{R}$ is differentiable and that the following equation has at most $n-1$ solutions: $$f'(x)=0, \quad x \in \mathbb{R}.$$ Prove that the following equation has at most $n$ solutions: $$f(x)=0,\quad x \in \mathbb{R}.$$
My proof is:
Let $f'(x)=0$ have solutions $x_1$, $x_2,\ldots ,x_{n-1}$.
since $$f'(x_1)=\lim\limits_{{x}\to{x_1}}\frac{f(x)-f(x_1)}{x-x_1} = 0$$ and doing so, $f(x)=f(x_{n-1})$ Therefore $f(x)=f(x_1)=f(x_2)=\cdots=f(x_{n-1})$.
Let $x_n$ be one of solutions of $f(x)=0$. $$0=f(x_n)=f(x_1)=f(x_2)=\cdots=f(x_{n-1}),$$ so $f(x)=0$ has solutions like $x_1$, $x_2,\ldots, x_n$.
If there is wrong part, please let me know.