TITLE: Possible conditions on subsets of Euclidean space to be embedded submanifolds
QUESTION [5 upvotes]: Consider a locally connected $X\subset \mathbb R^n$. Given a point $p\in X$, consider the following condition:

For any $a,b\in X$, if there's a path $a\to p\to b$ in $X$, there is also a
smooth path $a\to p \to b$ in $X$ with nonzero derivative at $p$ (at least once).

I think this condition may express that $X\subset\mathbb R^n$ is smooth at $p$.
Every point $p$ of Euclidean space satisfies this property since e.g the circle going through points $a,b,p$ furnishes a smooth path $a\to p\to b$. Consequently I think every point of an embedded manifold $X\subset\mathbb R^n$ satisfies this condition.
Question. Does this characterize manifolds embedded in Euclidean space? That is, if $X\subset \mathbb R^n$ is a locally connected subset whose every point satisfies the above condition, does it follow $X$ is an embedded manifold?
Added. Eric Wofsey's answer helped me realize I would like to assume $X$ is additionally locally Euclidean. His comment provides a counterexample to this case, namely the wedge in $\mathbb R^3$ formed by folding a rectangle along a line. This comment outlines the problem with the condition of my question. I have asked a follow-up question here.

REPLY [4 votes]: No.  For instance, let $X\subset\mathbb{R}^2$ be the union of the $x$-axis and the graph of the function $f(x)=\exp(-1/x^2)$.  This satisfies your conditions, but is not smooth at the origin.
In fact, such a set can be very far removed from being a manifold.  For instance, the set $X=\mathbb{R}^2\setminus\mathbb{Q}^2$ satisfies your conditions.  Given any three points $a,p,b\in X$, you can easily construct an uncountable family of smooth paths $a\to p \to b$ in $\mathbb{R}^2$ which have nonzero derivative at $p$ and whose images do not intersect except at $a$, $p$, and $b$.  Only countably many such paths can contain a point of $\mathbb{Q}^2$, so at least one of them is in $X$.