TITLE: Smooth surfaces that isn't the zero-set of $f(x,y,z)$
QUESTION [19 upvotes]: The zero-set of any smooth function $f(x,y,z)$ with a non-vanishing gradient is a smooth surface. I was wondering if the reverse is true: is every smooth surface in $E^3$ the zero-set of some smooth function? If not, what do the counterexamples look like?
I was thinking that a plane with a hole may qualify as a counterexample, but I have yet to prove it.

REPLY [4 votes]: Georges Elencwajg's "easy proof" is providing a "global solution" to your problem. Locally one can argue as follows: A smooth surface $S\subset{\mathbb R}^3$ is produced by a $C^1$-map
$${\bf g}:\quad(u,v)\mapsto\left\{\eqalign{x&=g_1(u,v)\cr y&=g_2(u,v)\cr z&=g_3(u,v)\cr}\right.$$ with $d{\bf g}(u,v)$ having rank $2$ at all points $(u,v)$ in sufficiently small neighborhoods $U$ of ${\bf p}$. We may assume that
$$\det\left[\matrix{g_{1.u}&g_{1.v}\cr g_{2.u}& g_{2.v}\cr}\right]\ne0\qquad\bigl((u,v)\in U\bigr)\ .$$
By the inverse function theorem it follows that there is a neighborhood $V$ of ${\bf q}=\bigl(g_1({\bf p}), g_2({\bf p})\bigr)$ and a $C^1$-inverse ${\bf h}'=(h_1,h_2)$ of ${\bf g}'=(g_1,g_2)$ mapping $V$ onto $U$. This mapping ${\bf h}'$ computes $(u,v)\in U$ for given $(x,y)$ in $V$. From this we can conclude that $S$ can be as well be presented by the map
$${\bf f}:\quad(x,y)\mapsto\bigl(x,y,\>g_3\bigl(h_1(x,y),h_2(x,y)\bigr)\bigr)\ .$$
Letting
$$g_3\bigl(h_1(x,y),h_2(x,y)\bigr)=:f(x,y)$$
the surface $S$ appears as solution set of the equation
$$z-f(x,y)=0\ .$$