$\newcommand\R{\mathbb R}$ $$f(x,y)=\frac{2}{x^2+(y-1)^2+1}-\frac{1}{x^2+(y+1)^2+1} \tag{1}\label{1}$$ will do. Indeed, this function $f$ has exactly three critical points: a saddle point $(0,\approx-8.54)$, a point of a local minimum at $(0,\approx-1.14)$, and a point of a local maximum at $(0,\approx1.04)$. --- For any given three distinct points $P,Q,R$ in $\R^2$ to be exactly the critical points of a function -- with a saddle at $P$, a local minimum at $Q$, and a local maximum at $R$, use $f\circ g$ instead of $f$, where $g$ is a diffeomorphism of the plane moving the given three distinct points $P,Q,R$ to the respective critical points $(0,\approx-8.54)$, $(0,\approx-1.14)$, $(0,\approx1.04)$ of $f$. Such a diffeomorphism exists, because - any three noncollinear points in $\R^2$ can be moved to any other three noncollinear points in $\R^2$ by a nonsingular affine transformation of $\R^2$ (which is of course a diffeomorphism); - any three collinear points in $\R^2$ can be moved to some three noncollinear points in $\R^2$ by a diffeomorphism; say, three distinct collinear points $(0,y_1)$, $(0,y_2)$, $(0,y_3)$ in $\R^2$ can be moved to the three noncollinear points $(e^{y_1},y_1)$, $(e^{y_2},y_2)$, $(e^{y_3},y_3)$ by the diffeomorphism $h$ defined by the formula $h(u,v):=(u-e^v,v)$ for $(u,v)\in\R^2$; - any diffeomorphism preserves critical points, local maxima points, local minima points, and saddle points. --- Below are the calculations for $f$, in Mathematica: [![enter image description here][1]][1] [![enter image description here][2]][2] [1]: https://i.sstatic.net/LAsPA.png [2]: https://i.sstatic.net/P8cgD.png