A differentiable and unbounded function with infinitely many critical points, all of them being local maxima. I'm searching for a function $f: \Bbb R^2 \rightarrow \Bbb R$ which has following properties:  


*

*Both $\frac{\partial f}{\partial x}$ and $\frac{\partial f}{\partial y}$ exist and are continuous in $\Bbb R^2$.   

*There are infinitely many critical points* , in all of which, $f$ has local maximum.  

*$f$ is unbounded both from above and from below.  


Could you give me some hints, or even better, show me explicitly the desired function?  
*$(x,y)$ such that $\frac{\partial f}{\partial x}(x,y)=\frac{\partial f}{\partial y}(x,y)=0$.
 A: NOTE. In this post I consider functions having only local minima, instead of maxima. Also, this is not a rigorous solution but only a hint.
There is a similar problem which asks to find a two-variable function that is unbounded above and below and that has only one critical point that is a local minimum. I saw somewhere the solution by Tim Gowers, which is the following recipe.
Take the graph of $f(x, y)=x$ and put a finger in it, at $(x, y)=(0,0)$. This creates a local minimum that is not global. This also creates a saddle point near the point $(x, y)=(-1, 0)$. Sliding the finger in the negative $x$ direction, the saddle point moves accordingly. Passing to the limit, we can make the saddle point disappear, as if it had "moved to the $x, y$ infinity". Done.
(Unfortunately I cannot find the precise reference. It is in a comment to some blog, so it is not indexed by search engines, I think.) 
You can redo this recipe countably many times, each time putting your finger far from what you have already done. This will produce an unbounded function with countably many local minima that are not global, and no more critical points. 
