Smooth function of infinitely many variables Consider $\mathbb{R}^\mathbb{N}$, the set of real-valued sequences $(x_n)_{n \in \mathbb{N}}$, as a mere set. Let $f : \mathbb{R}^\mathbb{N} \to \mathbb{R}$ be a function, and suppose that $f$ is smooth whenever we vary only finitely many arguments at a time.

Does it follow that $f$ only depends on finitely many arguments? In other words, is there a finite subset $F \subseteq \mathbb{N}$ and smooth $g : \mathbb{R}^F \to \mathbb{R}$ such that
$$ f = g \circ \pi,$$
where $\pi : \mathbb{R}^\mathbb{N} \to \mathbb{R}^F$ is the projection?

My suspicion is that the answer is yes, and that a proof may be possible by first showing the following weaker conjecture:

At every point of $\mathbb{R}^\mathbb{N}$, only finitely many partial derivatives of $f$ are nonzero.

 A: Define $f$ as $(x_n) \mapsto \lim_n x_n$ if $(x_n)$ converges, and $(x_n) \mapsto 0$ otherwise. Then $f$ is smooth, even constant, whenever you vary only finitely many indices (since this does not affect convergence or the value of the limit). But the value of $f$ does not depend only on finitely many indices (as the limits themselves do not).
A: Consider $f(x) = \limsup_{n \rightarrow \infty} \tan^{-1}(x_n)$. This is smooth (indeed constant) when restricted to finitely many variables, but it clearly does not factor through any finite $F$.
A: Here's an answer with a different mechanism than the (nice) answers involving limits.
Let $j(x) = \lfloor |x|\rfloor +2$, and let $g(x) = x^2(1-x)^2$. Define $f\colon\Bbb R^{\Bbb N}\to\Bbb R$ by
$$
f(x_1,x_2,\dots) = g\big( x_1-\lfloor x_1\rfloor \big) x_{j(x_1)}.
$$
Varying $x_1$ chooses which of the other variables is relevant to the value of $f$; the function $g$ ensures that the handoff from one $x_j$ to the next happens in a differentiable way. For greater smoothness, change $g(x)$ to $x^9(1-x)^9$ or to some nonconstant $C^\infty$ function that vanishes outside $(0,1)$.
