A nicer example still is:
f(0,0) = 0
f(x,y) = yx^2 / (x^4 + y^2) elsewhere
On any line y=mx we have f(x,y) = mx^3 / (x^4 + m^2x^2) = mx / (x^2 + m^2), and the limit as x->0 is 0, so the restriction of the function to the line y=mx is continuous everywhere. On the line x=0 we have f(0, y) = 0 / y^2, and the limit as y->0 is 0, so again the function is continuous everywhere.
But if you consider the restriction of the function to the parabola y=x^2, you get f(x, x^2) = x^4 / 2x^4 = 1/2, so the function is not continuous at the origin.
There's an exercise about this in the Baby Rudin book.
(
http://en.wikipedia.org/w/index.php?title=Walter_Rudin)