Continuous functions in the product topology on $\Bbb{R}^{\Bbb{N}}$ I'm trying to prove the following statement:
Let $(X, T )$ be a topological space, and let $f : X \rightarrow \Bbb{R^{\Bbb{N}}}$ be a function, where $\Bbb{R^{\Bbb{N}}}$ has the product topology. Let the coordinate functions of $f$ be called $f_n$, for $n \in \Bbb{N}$, so that for $x \in X$ 
$f(x) = (f_1(x), f_2(x), f_3(x), . . .)$
Then f is continuous if and only if $f_n : X \rightarrow \Bbb{R}$ is continuous for every $n \in \Bbb{N}$
One side is easy: If we write $f_n = \pi_n(f)$ where $\pi$ is the identity function then whenever f is continuous $f_n$ is also continuous as well since the product topology is the coarsest topology s.t $\pi$ is continuous. 
For the other direction I was thinking: $S_n = \{ \pi^{-1}_n(U) : U \in \Bbb{R}$ is open$\}$ is a subbasic set in $\Bbb{R}^{\Bbb{N}}_{prod}$. We want to show its preimage is open so $f^{-1}(\pi^{-1}_n(U))$ = $(\pi_n(f(U))^{-1}$ = $f_n^{-1}(U)$ which is open since $f_n$ is continuous, since this s true for all n we have that f is contiuous. 
 A: Restrict attention to base elements. A base for the product topology is furnished by elements of the form $B=I_1\times\cdots \times I_N\times \prod_{k>N} {\mathbb R}$ with $N$ finite and each $I_k$ open. Each $f_k^{-1} (I_k)$, $1\leq k\leq N$ is open and their (finite) intersection which equals $f^{-1} (B)$ is thus open. 
A: For one direction you write:

If we write $f_n = \pi_n(f)$ where $\pi$ is the identity function then whenever f is continuous $f_n$ is also continuous as well since the product topology is the coarsest topology s.t $\pi$ is continuous.

I think that you mean that $f_n=\pi_n\circ f$, where $\pi_n:\Bbb R^{\Bbb N}\to\Bbb R$ is the projection to the $n$-th factor. Assuming that you do, the argument is correct.
And for the other:

$S_n = \{ \pi^{-1}_n(U) : U \in \Bbb{R}$ is open$\}$ is a subbasic set in $\Bbb{R}^{\Bbb{N}}_{prod}$. We want to show its preimage is open so $f^{-1}(\pi^{-1}_n(U))$ = $(\pi_n(f(U))^{-1}$ = $f_n^{-1}(U)$ which is open since $f_n$ is continuous, since this s true for all n we have that f is contiuous. 

There are some problems with your notation, but the idea is right. First, in your definition of $S_n$ you mean that $U\subseteq\Bbb R$, not that $U\in\Bbb R$. Secondly, $(\pi_n(f(U))^{-1}$ doesn’t make sense: as it’s written, you’re trying to take the inverse of a subset of $\Bbb R$. Here’s (one way to say) what you’re trying to say:

Let $\mathscr{S}=\{\pi_n^{-1}[U]:n\in\Bbb N\text{ and }U\subseteq\Bbb R\text{ is open}\}$; $\mathscr{S}$ is a subbase for the product topology on $\Bbb R^{\Bbb N}$. We want to show that $f^{-1}[S]$ is open in $X$ for each $S\in\mathscr{S}$, so let $\pi_n^{-1}[U]\in\mathscr{S}$ be arbitrary. Then $f^{-1}[\pi_n^{-1}[U]=(f^{-1}\circ\pi_n^{-1})[U]=(f\circ\pi_n)^{-1}[U]=f_n^{-1}[U]$, which is open since $f_n$ is continuous.

