# Continuous function over compact subset and non-degenerate critical points

I am having trouble with this question, any help would be appreciated!

Let $f:A \to \mathbb{R}$ be twice differentiable in $A$ with its second derivative being continuous, where $A \subseteq \mathbb{R}$ is open. Suppose that every critical point of $A$ has its second derivative different from zero. Show that every compact contained in $A$ has a finitely number of non degenerate critical points.

I was trying to show that by taking an arbitrary compact subset of $A$. Since $f$ is continuous in $A$ it will be continuous in this compact, therefore, it will attain a maximum and a minimum in this interval. Since the second derivative of every critical point in $A$ is different from zero, this compact will have at most two non degenerate critical points.

Is this reasoning correct? Is this true for every compact subset of $A$?

• "...will attain a maximum and a minimum in this interval." What interval?A compact set needn't be connected. And why couldn't $f$ have $100$ nondegenerate critical points in a given interval? For example, $f(x)=\sin x$ on the open set $(0,1000)$ and consider the compact subset $[1,999]$. $f$ attains its maximum $1$ and its minimum $-1$ many times on this compact set. – MPW Mar 22 '18 at 15:30
• @MPW Well, the question ask us to prove it for every compact subset of the domain. This interval I was referring to is an arbitrary subset of the domain which is compact. But you are right, it can have way more than two non-degenerate critical points, I always forget about trigonometric functions. – André Cordeiro Valério Mar 22 '18 at 15:55

Since $f'$ is continuous, $f'^{-1}(\Bbb R \setminus\{0\})$ is open. Since $f''(x) \ne 0$ everywhere that $f'(x) = 0$, each $0$ of $f'$ is surrounded by some open set where $f'\ne 0$ except at that point. The collection of all of those open sets completely cover $A$.