A counterexample: $f(x,y):=x^2y^2$ if $xy\ne0$ and $f(x,y):=|x|+|y|$ otherwise.
A smooth counterexample: $f(x,y):=x^2y^2+(x^2+y^2)e^{-x^2y^2(x^2+y^2)}$.
A counterexample: $f(x,y):=x^2y^2$ if $xy\ne0$ and $f(x,y):=|x|+|y|$ otherwise.
A smooth counterexample: $f(x,y):=x^2y^2+(x^2+y^2)e^{-x^2y^2(x^2+y^2)}$.