Let $I$ be a set, and for each $i \in I$, let $U\_i$ and $V\_i$ be sets. Furthermore, suppose for each $i \in I$, there is a bijection $f\_i:U\_i \to V\_i$. Prove that there is a bijection $g:\prod\_{i \in I}U\_i \to \prod\_{i \in I}V\_i$.

Essentially, my mindset was to try demonstrating a bijective function $f$ using the information I was given. Basically, I think of the Cartesian products of $U\_i$ and $V\_i$ for $i \in I$ as follows:
$\left\{\left(a\_i\right)\_{i \in I}:\forall i \in I\left(a\_i \in U\_i\right)\right\}$, and $\left\{\left(b\_i\right)\_{i \in I}:\forall i \in I\left(b\_i \in V\_i\right)\right\}$

Then, $\forall i \in I$, we know that $f\_i:U\_i \to V\_i$ is a bijection. Then define $g:\prod\_{i \in I}U\_i \to \prod\_{i \in I}V\_i$ by setting $g\left(\left(a\_i\right)\_{i \in I}\right)=\left(f\_i\left(a\_i\right)\right)\_{i\in I}$.

Then, let $\left(a\_i\right)\_{i \in I} \ne \left(b\_i\right)\_{i \in I}$. Then, at least one element of $\left(a\_i\right)\_{i \in I}$ must differ from its corresponding element in $\left(b\_i\right)\_{i \in I}$. Without loss of generality, pick some $a\_0$ and its corresponding $b\_0$ from $\left(a\_i\right)\_{i \in I}$ and $\left(b\_i\right)\_{i \in I}$, respectively, and let $a\_0 \ne b\_0$.

Since for all $i \in I$, $f\_i$ is bijective, $f\_0\left(a\_0\right) \ne f\_0\left(b\_0\right)$. Then, since $g\left(\left(a\_i\right)\_{i \in I}\right)=\left(f\_i\left(a\_i\right)\right)\_{i\in I}$ and we have $a\_0 \ne b\_0$, it must be true that $g\left(\left(a\_i\right)\_{i \in I}\right) \ne g\left(\left(b\_i\right)\_{i \in I}\right)$.

Therefore, $g$ is injective. However, I am completely dumbfounded as to proving that $g$ is surjective. Any comments of suggestions for the proof I have so far are definitely welcome, and any advice as to how I should go about proving that $g$ is surjective would be greatly appreciated.