Former math grad student, now a lawyer for the last $28$ years. Just doing math for fun in my spare time.
I was browsing questions here and my mind went on a tangent. The following questions occurred to me, which I strongly suspect are related:
Let $S = \{x_n \mid n \in \Bbb N$ }$ \subseteq \Bbb R$ be a set with no accumulation points. (A subset of $\Bbb R$ with no accumulation points has to be countable, because you can partition $\Bbb R$ into countably many intervals as fine as you like, and if $S$ is not countable, the pigeonhole principle assures us that one of those intervals has uncountably many elements of $S$. Consider that interval and repeat the process countably many times with intervals having diameters that go to $0$, and you'll end up with an accumulation point of $S$.) Let $f:S \to \Bbb R$ be arbitrary. Is it always possible to extend $f$ to a $C^\infty$ function on $\Bbb R$? To an analytic function on $\Bbb R$?
If instead $S \subseteq \Bbb C$ (where $S$ has no accumulation points) and $f:S \to \Bbb C$ is arbitrary, is it always possible to extend $f$ to an analytic function on $\Bbb C$?
When I was in grad school, I focused on algebra and mathematical logic so I really have little idea how one would approach this question.
Since i am a bit strapped for time here is a solution for the smooth case which does not work for analytic functions (but verbatim for subsets of $\mathbb{R}^d$): First note that $S$ is discrete and we can find for every element $x$ in $S$ a small ball around $x$ which contains no other element of $S$. Adjusting choices we can arrange that no two of these balls intersect.
To see this we use that in every closed Ball around $0$ of Radius $n$ there are only finitely many Elements of $S$ (by your argument). So in particular we can separate every element in $B_n$ from each other as described such that the boundaries of the Balls have positive distance from the boundary of $B_n$. Continuing for every $n$ we can thus separate all points as described.
Now it is well known that every ball in the reals admits a smooth bump function, i.e. a smooth function $b$ which takes the value 1 at a Point (for our balls we choose the unique $x\in S$ as this point) and which is uniformly 0 outside of the ball. Pick for every ball such a bump function and multiply it with the function value of $f$ at the point $x$ which is contained in the ball. Summing up all These functions you obtain a smooth function taking the desired values, i.e. extending $f$.
Note: Due to the identity Theorem for analytic functions there are no analytic bump functions.