Can f be extended to a continuous map?

Here is an old Berkeley Preliminary Exam question (Spring 79).

Let $f : \mathbb{R}^n-\{0\} \rightarrow \mathbb{R}$ be differentiable. Suppose

$$\lim_{x\rightarrow0}\frac{\partial f}{\partial x_j}(x)$$ exists for each $j=1, \cdots ,n$.

(1) Can $f$ be extended to a continuous map from $\mathbb{R}^n$ to $\mathbb{R}$?

(2) Assuming continuity at the origin, is $f$ differentiable from $\mathbb{R}^n$ to $\mathbb{R}$?

End of question.

In the book by De Souza, the following solution is given for (1)

No, with the counter example $f(x,y)=\frac{xy}{x^2+y^2}$ for $(x,y)\neq (0,0)$.

This is not an extendable function, but $\lim_{x\rightarrow0}\frac{\partial f}{\partial x_j}(x)$ does not exists. I think the solution is wrong, any other correct counter example?

Thanks

-

Let $n =1$ and $f(x) = \text{signum}(x)$. Surely $f$ satisfies the conditions and surely it cannot be extended to a continuous function.

Though it feels like cheating...

-
It did feel like cheating, haha, I can't think of something in n=2 yet. –  KWO Dec 4 '12 at 12:53
I now believe that the book might be wrong, conclusion in (1) might be correct. –  KWO Dec 4 '12 at 12:58
Sorry, I retract my previous comment. –  KWO Dec 4 '12 at 13:00

In polar coordinates, with $\theta \in [0,2\pi), r \in (0,\infty)$: $f(r,\theta) = \sin \theta$. This takes every value in $[-1,1]$ in every neighbourhood of $(0,0)$.

Edited to add: As KWO points out in the comments, this example is flawed.

-
I think your example can be extended to continuous function, right? Just define f(0,0)=0 will do. –  KWO Dec 4 '12 at 14:11
@KWO: Read my last sentence again. –  TonyK Dec 4 '12 at 15:24
According to your argument $f_{\theta}=cos \theta$ also have trouble converging to zero, hence the hypothesis not satisfied. –  KWO Dec 5 '12 at 3:39
The hypothesis of the problem is that the limit of partial derivative exist when x goes to 0, in your construction, the limit of partial derivative with respect to theta does not exist when x goes to zero. –  KWO Dec 5 '12 at 10:51
OK, sorry. You are right (except that it's $f_x$ and $f_y$ that must tend to $0$, not $f_\theta$.) –  TonyK Dec 5 '12 at 11:07