TITLE: Real analyticity of continuous function via restriction to analytic curves
QUESTION [6 upvotes]: Suppose $X\subset \mathbb R^n$ is an irreducible real analytic sub-variety (i.e. the set of solutions of a system $f_1=\ldots=f_k=0$ with $f_i$ analytic)
Let $x\in X$ be a point and let $F: X\to \mathbb R^1$ be a continuous function defined on $X$ in a neighbourhood of $x$. I want to understand whether $F$ is real analytic on $X$. The question is whether the following would be sufficient to know.
Property. Suppose that for any real analytic map $\varphi: (-1,1)\to X$ sending $0$ to $x$ the composition $F\circ \varphi$ is analytic on $(-1,1)$.
Question. Does it follow from the property that $F$ is real analytic in a neighbourhood of $x$?
I am interested both in positive statements in this direction (possibly strengthening the condition of the Property) and in counterexamples.

REPLY [8 votes]: No. Take $X = \mathbb R^2$ and $F(x,y) = \frac{x^3}{x^2+y^2}$. Then $F$ is real-analytic everywhere but $(0,0)$. Moreover, at $(0,0)$, any curve passing through $(0,0)$ must have coordinates two analytic functions $x,y$ vanishing to orders $a,b$, in which case $x^2+y^2$ vanishes to order $2\min(a,b)$ and $x^3$ vanishes to order $3a > 2 \min(a,b)$ so the ratio is a well-defined analytic function.
But $F$ is not analytic at $(0,0)$.
A similar trick can be used to construct worse functions, like the irrational $F(x,y) = \frac{ x^5}{ \sqrt{ (x^2+y^2) (x^2 + 2y^2)}} $ and, by summing terms of this form, functions that fail to be analytic at many points.