Let $\mathbb{N} = \{1, 2, 3, ...\}$. I have two related questions:
[Main question]: Suppose I have a "Borel-measurable function $f:\mathbb{R}^{\mathbb{N}}\rightarrow\mathbb{R}$" and I have a sequence of Borel-measurable functions $g_i:\mathbb{R}\rightarrow\mathbb{R}$ for $i \in \{1, 2, 3, ...\}$. Can I conclude that the function $h:\mathbb{R}\rightarrow\mathbb{R}$ given by $$ h(x) = f(g_1(x), g_2(x), g_3(x), ...)$$ is Borel-measurable? This could be viewed as a composition $h(x)=f(v(x))$ where $v:\mathbb{R}\rightarrow\mathbb{R}^{\mathbb{N}}$ is defined by $v(x) = (g_1(x), g_2(x), g_3(x), ...)$.
[More basic question]: What should I be careful about when defining a "Borel-measurable function $f:\mathbb{R}^{\mathbb{N}}\rightarrow\mathbb{R}$"? I would like to know about any subtle issues, caveats, or pitfalls associated with functions of infinitely many variables. Is there only one Borel sigma-algebra on $\mathbb{R}^{\mathbb{N}}$ that everyone uses, or are there some choices? What does an "open subset of $\mathbb{R}^{\mathbb{N}}$" look like?
Any descriptions and/or references are welcome.
Edits: After some web searching, perhaps I can define the "open subsets of $\mathbb{R}^{\mathbb{N}}$" to be those sets of the form $$A \times \mathbb{R}\times \mathbb{R} \times \mathbb{R} \times...$$ for some positive integer $k$ and some open set $A \subseteq \mathbb{R}^k$. Then define the "Borel sigma algebra for $\mathbb{R}^{\mathbb{N}}$" as the sigma algebra generated by these. That the function $v:\mathbb{R}\rightarrow\mathbb{R}^{\mathbb{N}}$ ensures $v^{-1}(B)$ is a Borel-subset of $\mathbb{R}$ for every $B$ in this "sigma algebra of $\mathbb{R}^{\mathbb{N}}$" then follows (I believe) by an argument similar to that used at the following link, which I found to be very helpful: Show that inverse image of a Lebesgue measurable function is Lebesgue-measurable
I'm not sure about this, and I am still worried a bit about boundedness issues, and about issues of whether this is a "significantly rich" sigma algebra. It seems very specific and perhaps others could be used. Here is a test-case example: What if I define $$f(x_1, x_2, x_3, ... ) = \limsup_{n\rightarrow\infty} \arctan(x_n)$$ then can I say $f$ is Borel-measurable? It seems so, because I can say for any $y \in \mathbb{R}$ that $$ \{x \in \mathbb{R}^{\mathbb{N}} : f(x_1, x_2, x_3, ...) \leq y\} = \cap_{k=1}^{\infty} \cup_{n=1}^{\infty}\cap_{m\geq n} \{\arctan(x_m) \leq y + 1/k\}$$ and since $\{\arctan(x_m) \leq y + 1/k\} = \{\arctan(x_m)> y+1/k\}^c$ is a complement of an open subset of my "Borel sigma algebra of $\mathbb{R}^{\mathbb{N}}$" then this is indeed a sequence of countable complements, unions, and intersections of open subsets in the sigma algebra. This seems reasonable to me right now, but I am not confident in these conclusions and some validation and further illumination of caveats or pitfalls are welcome.