Can one characterise smoothness/analyticity of submanifolds by only looking at paths? Let $S\subset\mathbb{R}^n$ be a smooth/analytic submanifold of $\mathbb{R}^n$ of dimension $k$, i.e. for each $x\in S$ there exist open $A\ni x$, $B\ni 0$ in $\mathbb{R}^n$ and a smooth/analytic diffeomorphism $f:A\rightarrow B$ satisfying $f(x)=0$, $f(S\cap A)=(\mathbb{R}^k\times\{0\})\cap B$. Then for any $x,y,z\in S$ close enough to each other I can construct a path $a(t)$ between them satisfying $a(-1)=x$, $a(0)=y$, $a(1)=z$ which is analytic and stays inside $S$. 
Is the converse true? If for any $x,y,z\in S$ close enough to each other I can construct an analytic path between them in $S$ my intuition tells me that a neighbourhood of $y$ is an analytic submanifold, and so if this can be done for all $y$ then $S$ is, but I'm not sure how to prove it. 
 A: The answer is certainly no if you don't require the curve to be regular (see my comment below the original question). 
I think the answer is no even if you add the requirement that the three points be connected by a regular curve. Here's a sketch of a counterexample: Let $S$ be the following subset of $\mathbb R^2$:
$$
S = \big\{(x,y)\in \mathbb R^2: |y|\ge x^2\}.
$$ 
This is the union of two regions bounded by parabolas that are tangent at their common vertex. 
Given any three points $p,q,r\in S$, it's certainly possible to find a smooth regular curve $a$ satisfying $a(-1)=p$, $a(0)=q$, and $a(1)=r$ -- you just have to make sure that each time the curve passes through the origin, either its velocity is not horizontal or its curvature is sufficiently large that it stays above or below the appropriate parabola. I'm 95% sure you can also do it with a real-analytic curve -- one way to do it might be to create a smooth curve, then approximate that curve uniformly in $C^2$ with a real-analytic curve; this new curve might not exactly go through the three points, but it will get close, and you can add a very small polynomial curve to ensure that it hits the three points at the right times and also that it hits the origin whenever the original curve did.
