I need help with this question:
Let $f,g:\mathbb{R}^2\rightarrow\mathbb{R}$ be two $C^2$ functions, and let $S=${$(x,y)\in\mathbb{R}^2:g(x,y)=0$}. Suppose that $g(0,0)=\frac{\partial g}{\partial x}(0,0)=0$ and $\frac{\partial g}{\partial y}(0,0)\neq0$. Also assume that there exists $\lambda \in \mathbb{R}$ such that $\nabla f(0,0)=\lambda\nabla g(0,0)$ and $\frac{\partial^2f}{\partial x^2}(0,0)<\lambda\frac{\partial^2g}{\partial x^2}(0,0)$.
Prove that there exists $\delta>0$ such that for all $(x,y)\in S$, if $\|(x,y)\|<\delta$, then $f(x,y)\le f(0,0)$.
Please, I can't do it.
We can bring $g$ and $f$ into the form
$$g(x,y)=x^2\,h_1(x,y)+y\,h_2(x,y) \qquad f(x,y)=x^2\,k_1(x,y) + y\, k_2(x,y)+\kappa$$
$\kappa \in \mathbb{R}$. $h_1, h_2, k_1, k_2$ are continuous and satisfy the following conditions:
$$h_2(0,0)=\partial_y g(0,0) \neq 0 \qquad k_2(0,0)=\lambda h_2(0,0)\qquad k_1(0,0)<\lambda h_1(0,0)$$
This comes from the following consideration: If $f(x,y)$ is continuously differentiable then
$$f(x,y)-f(0,0)=\int_0^1 dt \frac{df(tx,ty)}{dt}=\int_0^1 dt(x\partial_x+y \partial_y) f(tx,ty)=x\int_0^1dt\partial_x f+y\int_0^1dt\partial_yf$$
By doing this construction again with $\partial_x f$ we get the functions $k_1, k_2$. The conditions follow from comparison with the conditions in the question.
If we make $\delta$ very small, since $h_1,h_2,k_1,k_2$ are continuous we can assume $h_2\neq0$ and $k_1<\lambda h_1$ to hold on an entire ball $B_\delta(0)$. Solutions of $g(x,y)=0$ in the ball then have the form $y=-x^2\frac{h_1(x,y)}{h_2(x,y)}$.
$f$ at this point evaluates to $x^2(k_1(x,y)-h_1(x,y) \frac{k_2(x,y)}{h_2(x,y)})+\kappa$. From continuity, given any $\epsilon$ we can choose a $\delta$ small enough so that $|\frac{k_2(x,y)}{h_2(x,y)}-\lambda|<\epsilon$ (as the expression is zero at $(0,0)$).
So $f$ is smaller than $x^2(k_1(x,y)-\lambda h_1(x,y))+x^2\epsilon+\kappa$. Since $k_1(x,y)<\lambda h_1(x,y)$ the first term is negative. The negative term goes with $x^2 (k_1(0,0)-\lambda h_1(0,0))$ when $\delta$ is very small, whereas $\epsilon$ term goes with $x^2 \epsilon$. By taking $\epsilon$ to be super small, the sum of these two terms will eventually be negative.
So finally $f$ evaluates at the zeros of $g$ to something smaller than a negative term $+ \kappa$, so to something smaller than $f(0,0)$.