Prove that $f$ has finite number of roots

Let $f:[0,1]\to \mathbb{R}$ be a differentiable function. If there do not exist any $x\in[0,1]$ such that $f(x)=f'(x)=0$, prove that $f$ has only finite number of zeros in $[0,1]$.

I'm not getting any idea how to proceed.


Combining the comments:

Assume by contradiction that $f$ has infinitely many zeroes in $[0,1]$. Then, we can find a sequence $x_n$ so that $f(x_n)=0$.

As $[0,1]$ is compact, $x_n$ has a converging subsequence. Lets call this subsequence $y_n$ and let $y=\lim_n y_n$.

Then by continuity $f(y)=0$ and $f'(y) =\lim_{x \to y} \frac{f(x)-f(y)}{x-y}=\lim_{n \to \infty} \frac{f(y_n)-f(y)}{y_n-y}=0$ contradiction.


The OP's last comment indicates that he may still be clueless, so here is a more explicit suggestion. First use the Taylor formula $f(x)=f(x_0)+ f'(x_0)(x-x_0) + o(x-x_0)$ to show that zeros with nonvanishing derivative must be isolated. This means that there is an open interval containing $x_0$ with no other zeros in it. Taking such an interval for each zero, we get an open cover of the set of zeros. Now use the compactness of the set of zeros of $f$ in $[0,1]$.