TITLE: Can continuity of a function be checked by restricting to smooth curves?
QUESTION [22 upvotes]: Well-known example: Consider the function 
$$f(x,y)=\left\{\begin{array}{c}
\frac{x^2y}{x^4+y^2} & \text{if }(x,y)\neq(0,0)\\
0 & \text{if }(x,y)=(0,0)
\end{array}\right.$$
When restricted to any straight line through the origin, this function is continuous. However, if we approach the origin along the parabola $y=x^2$, we get a limit of $\frac 12$, so $f$ is actually discontinuous. The question is whether smooth curves can always ferret out discontinuity in this way.

Does there exist a function $f:\mathbb R^2\to \mathbb R$ which is discontinuous at a point $x$, but is continuous at $x$ when restricted to any smooth curve?

Discontinuity is witnessed by a sequence $\{x_i\}$ converging to $x$ so that $\{f(x_i)\}$ does not converge to $f(x)$. Since we could take $f$ to be the characteristic function on $\{x_i\}$, the above question is equivalent to the following.

Given a convergent sequence $\{x_i\}$ in $\mathbb R^2$, must there be a smooth curve passing through infinitely many of the $x_i$?

REPLY [13 votes]: Yes you can do this. Suppose you have a sequence of points $c_n$ which converges very fast to zero, so that $n^k c_n$ is bounded for all $k$. Let $h$ be a smooth function that is equal to $0$ for $x\le -1$  and $1$ for $x\geq 0$. Let $t_n=\frac{1}{(n+1)^2}+2\sum_{k=1}^n \frac{1}{k^2}$ and
$$g(x)=\sum_{n\geq 0}h(1+n^2(x-t_n))h(1-n^2(x-t_n))c_n$$
then $g(t_n)=c_n$ and g is smooth because the fast convergence of the $c_n$ implies that the derivatives of all orders of the terms in the summation are uniformly bounded. This proof works in greater generality and the result is called "the general curve lemma". See 12.2 in Kriegl-Michor, "The convenient setting of global analysis".

REPLY [12 votes]: Usually, by a "smooth curve through $0\in\mathbb R^2$", one means a $C^k$ mapping $f:[-a,a]\to\mathbb R^2$ where $k\ge 1$ is the desired degree of smoothness, $a>0$, $f(0)=0$, and $f'(x)\ne 0$ for all $x\in[-a,a]$ (without the last condition, you can get quite ugly images even of $C^\infty$ mappings). Equivalently, a smooth curve is a graph of a $C^k$-function near the origin after some rotation of coordinates. Now, the answer depends on $k$. If $k=1$, then there is a subsequence $x_n$ approaching $0$ from some limiting direction. Choosing this direction as the positive semiaxis, we see that we can rarefy the sequence a bit and put everything on a $C^1$ graph with $0$ derivative at the origin. On the other hand, to request any particular modulus of continuity for $f'$ is already impossible because that would require some estimate of the kind $|\mbox{arg}(x)|\le \omega(|x|)$ with some fixed function $\omega$ tending to $0$ at $0$ where $\mbox{arg}$ is measured from the limiting direction. However, we can construct a sequence of points whose absolute values tend to $0$ very fast while their arguments tend to $0$ very slowly.

REPLY [2 votes]: Just for the sake of exposition, take ${\Bbb C}$ as the model of ${\Bbb R}^2$.  Given a sequence $(z_n)$ of non-zero complex numbers which converges to 0, the compactness of $S^1$ entails the existence of a subsequence such that Arg$(z_n)$ converges. Then, passing if necessary to an even thinner subsequence $(w_n)$, one can also get the convergence od the arguments monotonic and one-sided (in some appropriate sense). Connecting the dots, even just with line segments, gives a curve smooth at 0, and a little more care will make it smooth everywhere.  (I assume "smooth" here means $C^1$...I don't think $C^n$ is much harder, but I haven't thought about $C^\infty$.)