Suppose that $f(x,y)$ is a nonzero polynomial of degree at most 2. Observe the following set: $$S=\{(x,y) : f(x,y)=0 ,\; \partial_{x}f(x,y)=0,\; \partial_{y}f(x,y)=0 \}.$$ Note that this set is the intersection of zeros of $f$ and critical points of $f$. One may see that $S$ is finite union of points or a line. This case is easy.
I'm interested in the generalization of this problem. More precisely, let $f(x,y,z)$ be a nonzero polynomial of degree at most $3$. Consider the following set: $$S=\{(x,y,z): f(x,y,z)=0,\; \nabla f(x,y,z)=0 \}. $$ I want to classify the set $S$.
If $f=x^3$, then $S$ is a hyperplane.
If $f=x^2+y^2+z^2$, then $S$ is finite union of points.
If $f=x^2+y^2$, then $S$ is a 1-dimensional surface.
It seems to make sense that $S$ is a hyperplane or finite union of points or a 1-dimensional surface. But I don't know how to attack this problem. Any comments will be welcomed.