What's a good example to illustrate the fact that a function all of whose partial derivatives exist may not be continuous?

The standard example I have seen is: $f(x,y)=\frac{2xy}{x^2+y^2}$. 


I was travelling when this came up. With the same results as Georges Elencwajg's comment and Marco's recent answer, take $$ f(x,y) = \frac{2 x^2 y}{x^4 + y^2} $$ and set to $0$ at the origin $(0,0).$ Along any line through the origin $ x = a t, \; y = b t$ the limit is 0, as $$  f(a t, b t)  \leq a^2  t / b  . $$ However, along the parabola $y = x^2$ the value is 1, and along the parabola $y =  x^2$ the value is $1.$ To get "directional derivative" 0 in every direction through the origin switch to $$ g(x,y) = \frac{2 x^3 y}{x^6 + y^2} $$ as $$  g(a t, b t)  \; \leq \; t^2 \;  a^3 / b  $$ when $b \neq 0,$ but then if $y = \pm x^3$...the directional derivative generalizes to the Gateaux derivative in other settings. 


Consider $f(x,y)=1$ on the set $\lbrace{(x,y):y=x^2}\rbrace\backslash\lbrace(0,0)\rbrace$ and $f(x,y)=0$ on any other point. 


I feel it's more informative to have the thought process that leads to the example rather than just be told some magic formula that works, however simple that formula might be. Here is a way of explaining it. We'll decide that our function is going to be discontinuous at (0,0). In order to ensure that the partial derivatives there are defined we'll try the simplest thing and make the function zero on the two axes. How can we make sure that it is discontinuous at (0,0)? Well, a simple way might be to make the function equal to 1 on the line x=y. (If you object that that step was unmotivated, then read on  it will become clear that I could have chosen pretty well any function and the argument still works.) How are we going to make sure that the function has partial derivatives everywhere? We could do it by trying to give it a nice formula everywhere. We care particularly about how the function behaves when you keep x or y constant, so let's see what happens if we try to choose the nicest possible dependence on y for each fixed x. If we do that then we'll be tempted to make the function linear. Since f(x,0)=0 and f(x,x)=1, this would tell us to choose f(x,y)=y/x. Unfortunately, that doesn't work: we also need the function to tend to zero for fixed y as x tends to zero. But at least this has given us the idea that we would like to write f as a quotient. What properties would we need of g and h if we tried f(x,y)=g(x,y)/h(x,y)? We would want g(x,0)=g(0,y)=0, g(x,x)=h(x,x), and h(x,y) is never 0 (except that we don't mind what happens at (0,0). We also want g and h to be nice so that the partial derivatives will obviously exist. The simplest function that vanishes only if (x,y)=(0,0) is $x^2+y^2$. The simplest function that vanishes when x=0 or y=0 but not when $x=y\ne 0$ is $xy$. Multiply that by 2 to get 1 down the line x=y and there we are. Now suppose we had wanted the value to be, say, $e^{1/x}$ at (x,x), so that the function is wildly unbounded near (0,0). Then we could just multiply the previous function by $\exp((2/(x^2+y^2))^{1/2})$. The main point I want to make is that we could just as easily have chosen many other functions. For example, $\sin(x)\sin(y)/(x^4+y^4)$ vanishes on the axes and clearly does not tend to zero down the line x=y (in fact it tends to infinity). 

