
Looking at the line passing through the origin, it looks like $g(x,y)=x-y-3$, because if $k=-3$, then $-3=0-0-3$, but this is not correct. Any help?

Looking at the line passing through the origin, it looks like $g(x,y)=x-y-3$, because if $k=-3$, then $-3=0-0-3$, but this is not correct. Any help?
On
The function should be expressed as $$g(x,y)=ax+by+c$$
The gradient is:
$$\nabla g(x,y) = (g_x,g_y)=(a,b)$$
such that
$$(a,b)=\lambda(1,-1)\implies a=-b$$
$$a^2+b^2=4\implies a=\sqrt{2} \quad b=-\sqrt{2}$$
thus
$$g(x,y)=\sqrt{2}x-\sqrt{2}y+c$$
finally when $$g(x,y)=3$$ the equation is $$x-y=0$$ thus
$$c =3$$
thus
$$g(x,y)=\sqrt{2}x-\sqrt{2}y+3$$
The suggested pattern is $g(x,y)=a(x-y)+b$ . Choose two points and compute $a$ and $b$.
You will find $a=-3$ and $b=-3$. Then $g(x,y)=-3(x-y+1)$