If $F=\{(x,y,z)\in\mathbb R^3:f(x,y,z)=0\}$ is non-empty and $\frac{\partial f}{\partial x}\neq0$ on $F$, can $F$ be finite?

In our analysis exam, we were given the question

Let $f:\mathbb R^3\to \mathbb R$ is a $\mathcal C^\infty$-smooth function. Let $F=\{(x,y,z)\in \mathbb R^3: f(x,y,z)=0\}$ is non-empty and $\frac{\partial f}{\partial x}\neq 0$ on $F$. Prove or give a counterexample-

$F$ can never be a collection of finitely many points in $\mathbb R^3$.

On one hand, I tried to figure out a lot of counterexamples none of which worked. And, on the other hand, I couldn't figure out any way to show that one point in $F$ forces more of them. I can't show much of my work except some counterexamples, which I thought were quite close

  1. $f(x,y,z)=x^2+y^2+z^2$ which gives only one point in $F$ which is unfortunately the point where $\frac{\partial f}{\partial x}=0$.

  2. $f(x,y,z)=x^2+y^2+z^2+1$ which satisfies all other properties except that $F$ is not non-empty.

I couldn't figure out any more.


Solution 1:

No, $F$ cannot be finite and non-empty. Suppose otherwise, and take $p\in F$. There is some $r>0$ such that $p$ is the only zero of $f$ on $B_r(p)$. Then, you always have $f(q)>0$ when $q\in B_{r'}(p)\setminus\{p\}$ for some $r'\in(0,r)$ or you always have $f(q)<0$ when $q\in B_r(p)\setminus\{p\}$ for some $r'\in(0,r)$. Otherwise, there would be, for every $n\in\Bbb N$, points $p_n,q_n\in B_r(p)\setminus\{p\}$ such that$$\|p_n-p\|,\|q_n-p\|<\frac1n\quad\text{and that}\quad f(p_n)>0>f(q_n).$$And then, for each $n\in\Bbb N$, you could take some continuous path in $B_{1/n}(p)$ going from $p_n$ to $q_n$ without passing through $p$; it follows from the intermediate value theorem that $f$ has some zero in the range of such a path. But we are supposing that $f$ has no zeros on $B_r(p)$.

So, $f$ has a local maximum or a local minimum at $p$, and therefore $\frac{\partial f}{\partial x}$ is $0$ there.