Understanding the proof of product of completely regular space is completely regular under product topology Below is the proof:

Proof. Let $a=\prod_{i\in I}a_i\in\prod_{i\in I}X_i$ and $U$ be any open set containing $a$. Then there exists a finite subset $J$ of $I$ and sets $U_i\in\tau_i$ such that
$$a\in\prod_{i\in I}U_i\subseteq U$$
where $U_i=X_i$ for all $i\in I\setminus J$. As $(X_j,\tau_j)$ is completely regular for each $j\in J$, there exists a continuous mapping $f_j:(X_j,\tau_j)\longrightarrow[0,1]$ such that $f_j(a_j)=0$ and $f_j(y)=1$, for all $y\in X_j\setminus U_j$. Then $f_j\circ p_j:\prod_{i\in I}(X_i,\tau_i)\longrightarrow[0,1]$, where $p_j$ denotes the projection of $\prod_{i\in I}(X_i,\tau_i)$ onto $(X_j,\tau_j)$.
If we put $f(x)=\max\{f_j\circ p_j(x):\ j\in J\}$, for all $x\in\prod_{i\in I}X_i$ then $f:\prod_{i\in I}(X_i,\tau_i)\longrightarrow[0,1]$ is continuous (as $J$ is finite). Further, $f(a)=0$ while $f(y)=1$ for all $y\in X\setminus U$. So $\prod_{i\in I}(X_i,\tau_i)$ is completely regular. $\qquad\square$

I am trying to understand the line $f(x)=\max\{f_j(p_j(x)):\ j\in J\}$. What does this function mean and what is the point of it? What exactly are we taking the max of? We have not assumed that any of the $X_i$ are ordered or are sets that even contains a max.
 A: For each $j\in J$ you have a continuous function $f_j:X_j\to[0,1]$ such that $f_j(a_j)=0$, and $f_j(y)=1$ for each $y\in X_j\setminus U_j$. Now let $x\in X=\prod_{i\in I}X_i$. For each $i\in I$ we have the projection map $p_i:X\to X_i$. In particular, $p_j(x)$ is a point in $X_j$ for each $j\in J$, so we can apply $f_j$ to it to get
$$(f_j\circ p_j)(x)=f_j\big(p_j(x)\big)\in[0,1]\,.$$
That is, for each $j\in J$ we have a number $(f_j\circ p_j)(x)$ in $[0,1]$, and
$$\{(f_j\circ p_j)(x):j\in J\}$$
is therefore a finite subset of $[0,1]$. Since this is a finite set of real numbers it has a maximum element;
$$\max\{(f_j\circ p_j)(x):j\in J\}$$
is that maximum element. We now define a function $f$ from $X$ to $[0,1]$ by setting $f(x)$ equal to this maximum element:
$$f:X\to[0,1]:x\mapsto\max\{(f_j\circ p_j)(x):j\in J\}\,.$$
Thus,
$$\begin{align*}
f(a)&=\max\{(f_j\circ p_j)(a):j\in J\}\\
&=\max\left\{f_j\big(p_j(a)\big):j\in J\right\}\\
&=\max\{f_j(a_i):j\in J\}\\
&=0\,,
\end{align*}$$
since $f_j(a_j)=0$ for every $j\in J$. And if $x\in X\setminus U$, there must be a $j\in J$ such that $x_j\in X_j\setminus U_j$. so $(f_j\circ p_j)(x)=f_j(x_j)=1$, and therefore $f(x)=1$. Thus, $f$ will be the desired function if it is continuous, and continuity follows (with a little work) from the fact that $J$ is finite. (If you have trouble proving this, try it first on the assumption that $|J|=2$.)
