I have the following question from exercise 59 or 2.4.1 (4) in Terence Tao's notes on measure theory.
Let $((X_{\alpha},\mathfrak{B_{\alpha}}))_{\alpha \in A}$ be a familiy of measurable spaces and define the product $\sigma$-algebra on $X_A$ to be the smallest $\sigma$-algebra such that all the coordinate functions are measurable.
I want to show that
If $f:\ X_a\ \to\ [0,\infty]$ is $\mathfrak{B}_A$-measurable then there exists an at most countable set $B\subset A$ and a $\mathfrak{B}_B$-measurable function $f_B:\ X_B \ \to \ [0,\infty]$ such that $f=f_B \circ\pi_B$
I can do the following:
If we for $B\subset A$ denote with $\mathcal{Z}_B\subset \mathfrak{B}_A$ the set of all $\pi_B^{-1}(E_B),\ E_B \in \mathfrak{B}_B$ we have (from the exercise 2.4.1 (3) done before) that for any $E_A \in \mathfrak{B}_A$ that there exists some countable $B\subset A$ such that $E_A \in \mathcal{Z}_B$.
Finding such a countable $B_i$ for each $F_i \subset [0,\infty]$ in some countable generator of $\mathcal{B}([0,\infty])$ and letting $J=\cup B_i$ we get that $f$ is measurable with respect to $\mathcal{Z}_J$ (Where $J$ of course is countable) From this we get the sense in whihch $f$ only depends on a countable number of coordinates.
Now I would believe that $f=\left.f\right|_{X_J} \circ \pi_J $, and I know that $f=\left.f\right|_{X_J}$ is $\mathcal{Z}_B$-measurable. But I'm unsure of how to prove the equality of these two functions
You are on the right path, but there is an issue in how you implemented it. Note that $X_J\times X_{A\setminus J}$ can be identified in a natural way with $X_A$. It follows that $X_J$ is a factor of $X_A$ and not a subset; in particular, the restriction $\left.f\right|_{X_J}$ is not well-defined.
In order to define the function $f_J$ so that $f=f_J\circ\pi_J$, pick any $y\in X_{A\setminus J}$ and define $f_J$ by $f_J(x)=f(x_J,y_{A\setminus J})$, where we identify $X_A$ with $X_J\times X_{A\setminus J}$.
Let's verify that $f=f_J\circ\pi_J$, which amounts to showing that $f(x_J,x_{A\setminus J})=f(x_J,y_{A\setminus J})$. Suppose not, then there exists a measurable set $F\subseteq [0,\infty]$ that contains $f(x_J,x_{A\setminus J})$ but not $f(x_J,y_{A\setminus J})$. But then $f^{-1}(F)$ would not be in $\mathcal{Z}_J$. A similar argument shows also that $f_J$ is $\mathcal{Z}_J$-measurable.