$X$ is a submanifold of $\mathbb{R}^{n}$ if and only if for all $p\in X$ exist an open set $U\subset\mathbb{R}^{n}$ and a $C^{\infty}$ map $r:U\rightarrow U$ such that $r\circ r=r$ and $X\cap U=r(U)$.
In the first way $\Rightarrow$ i think it is easy but in the second way $\Leftarrow$ i am not shure how to carry that to the definition of a submanifold.
The proof of this is given on the nLab here .
An interesting thing to note, as the page discusses, is that since every (finite-dimensional, Hausdorff, second countable) smooth manifold admits an embedding into $\mathbb{R}^n$ for some $n$, then in fact this construction completely characterizes all smooth manifolds, and the category of smooth manifolds can be seen to be the Karoubi envelope (idempotent-splitting completion) of the category of open subsets of Cartesian spaces. As explained in Remark 4.2 of the aforementioned article, this was advocated by Bill Lawvere as a nice way to immediately generalize many constructions on $\mathbb{R}^n$ to smooth manifolds in general, without having to tediously verify compatibility with coordinate changes.