Problem statement: Let $M \subseteq \mathbb{R}^3$ be a compact, embedded, 2-dimensional Riemannian submanifold. Show that $M$ cannot have $K \leq 0$ everywhere, where $K$ stands for the Gauss curvature of $M$.
I have attempted an approaches (described below), but have not been able to finish it off.
I came across a hint suggesting that I consider the square-of-distance function $f: \mathbb{R}^3 \rightarrow [0,\infty)$ by $f(x)=|x|^2$. As $M$ is compact, there is some $q_0 \in M$ such that \begin{equation} \forall q \in M: \quad f(q) \leq f(q_0). \end{equation} We also know that \begin{equation} \forall v \in T_{q_0} M: \quad df_{q_0}(v) = \frac{d}{dt}\bigg|_{t=0} (f \circ \gamma_v)(t) = 0\quad \text{and} \quad (f \circ \gamma_v)''(0) \leq 0. \end{equation} The problem now is that I do not know how to relate the above statements to a statement about the curvature $K(q_0)$.
I would appreciate any suggestions on either of the above approaches.