Try $f(x,y)=x^2+y^2$, $f \colon \mathbb{R}^2 \to \mathbb{R}$.