Long story short: $f\subset I\times \cup_{i \in I}S_i$ means that $I$ is domain and $\cup_{i \in I}S_i$ is codomain. $f_i\in S_i$, so $f_i$ is an element of codomain. Moreover, $f(i)=f_i$ from definition. It is true, that $(i, f_i) \in f$, but in proof there is different notation, namely $(i, s_i) \in f$. I admit this notation is somewhat confusing.
It is helpful to start from beginning and carefully build things up. First of all $I$ is an arbitrary nonempty set. Then there is some auxiliary nonempty set of sets (aka family of sets) call it $X$. Now we need to fix some function $\Phi$ with domain $I$ and codomain $X$, thus $\Phi:I\to X$. In set language $\Phi=\{(i,x):i\in I ,x\in X \}$. Looks familiar? Observe, that if we take $X:=\{ S_i:i\in I\}$ and define $\Phi(i):=S_i$, then $\Phi=S$. It can be helpful to look at the case when $I=\{1,..,n\}$, and $|X|=m$ is also finite. Fix $\Phi: \{1,..,n\}\to X$, if $\Phi$ is surjection (so $n\geq m$), all elements of $X$ can be listed (probably many times) $X=\{\Phi(1),..,\Phi(n)\}$. Now take $X_i:=\Phi(i)$. For finitary product there is no need to introduce all that stuff, just simple induction:
$X_1\times X_2=\widehat\prod_{i=1}^2X_i=\{(x_1,x_2):x_1\in X_1,x_2\in X_2\}$
$\widehat\prod_{i=1}^nX_i=(\widehat\prod_{i=1}^{n-1}X_i)\times X_n$
(There should be big "$\times$" sign instead of $\widehat\prod$, like $\textbf{here}$.)
What is important, in finitary case induction based definition is equivalent to the "functional" one (there is cannonical bijection):
- $\Pi_{i=1}^nX_i=\{f:f\ is\ a\ function\ on\ \{1..n\}\ and\ f(i)\in X_i\}$
It is helpful to see what is inside though:
$$\widehat\prod_{i=1}^nX_i=\{(x_1,..,x_n):x_i\in X_i\}$$
$$\prod_{i=1}^nX_i=\{\{(1,x_1),..,(n,x_n)\}:x_i\in X_i\}$$
If induction based product is so simple, couldn't it be extended to arbitrary indexing set? It cannot and $\underline{\textbf{here}}$ is why.
Exponent analogy to numbers (or more general cardinals) is that $|\{f:\ f\subset A\times B ,\ f\ is \ function\}|=|B|^{|A|}$, see $\underline{\textbf{here}}$.