TITLE: Smoothness in $\mathbb{R}^n$
QUESTION [6 upvotes]: Embarrasingly simple question, but I got the feeling that I cannot see the forrest for the trees right now:
If I have a function $f: \mathbb{R}^2 \rightarrow \mathbb{R}$ and want to show that it is in $C^\infty(\mathbb{R}^2)$, is it enough to show that $\forall (x, y) \in \mathbb{R}^2$ the functions restricted to one of the parameters, $f_x: \mathbb{R} \rightarrow \mathbb{R}, t \mapsto f(x, t)$ and $f_y: \mathbb{R} \rightarrow \mathbb{R}, t \mapsto f(t, y)$ are in $C^\infty(\mathbb{R})$?
I have a gut feeling that this could be problematic, but I can't seem to construct a counterexample. Any help would be much appreciated.

REPLY [2 votes]: This question was answered in the comments.

... I think $f(x,y)=xy/(x^2+y^2)^{1/2}$, $\,f(0,0)=0$, is the counterexample you're looking for, since when restricted to the axes it’s constant zero, while the function as a whole is not differentiable at the origin.
–  Lubin Jan 18 '13 at 17:41