Prove or disprove: $f:\mathcal{A}^\mathbb{N} \rightarrow \mathcal{B}$ is continuous $\iff$ $f$ depends on finite numbers of coordinates

It's trivial that if $f$ depends on finitely many coordinates, then $f$ is continuous, in this setting: $\mathcal{A}^n$ is discrete (as $n$ is finite and $\mathcal{A}$ is discrete) so $g$ is always continuous as a function on a discrete space and by definition $f= g \circ \pi_n$, where $\pi_n: \mathcal{A}^\mathbb{N} \to \mathcal{A}^n$ is the projection onto the first $n$ coordinates (continuous by the definition of the product topology) so $f$ is also continuous as a composition of continuous maps.

The other direction is also quite simple: $f^{-1}[\{b\}]$ is a compact (and open) subset of $\mathcal{A}^\mathbb{N}$ and so a finite union of basic open sets (i.e. cilinder sets):

$$f^{-1}[\{b\}]= \bigcup \{ C[F], F \in \mathcal{F}_b\}$$

where $C[F]$ is a cilinder set based on a finite tuple $F$ from some finite power $\mathcal{A}^{n(F)}$, and we collect all needed $F$ for the fibre in some finite set of tuples $\mathcal{F}_b$.

Then $N=\max\{n(F): F \in \cup_{b \in B} \mathcal{F}_b\}$ is a well-defined (finite) integer and then you can go and show that (fixing some $a_0 \in \mathcal{A}$) that $g(x_1,\ldots,x_N) = f(x_1,x_2,\ldots,x_N, a_0,a_0,\ldots)$ is well-defined (i.e. does not depend on how we fill in the final coordinates) and witnesses the fact that $f$ depends on the first $N$ coordinates.