Theorem 33.2 of Munkres’ Topology 
A subspace of a completely regular space is completely regular. A product of completely regular spaces is completely regular.

My attempt: Let $Y\subseteq X$. Let $\{y\}$ be a singleton set in $Y$. Since $X$ is $T_1$, $\{y\}$ is closed in $X$. By theorem 17.2, $\{y\}= Y\cap \{y\}$ is closed in $Y$. Hence $Y$ is $T_1$. Let $x\in Y$ and $B$ is closed in $Y$ such that $x\notin B$ (i.e. $\{x\} \cap B =\emptyset$). By theorem 17.2, $B=C\cap Y$; $C$ is closed in $X$. If $x\in C$, then $x\in Y\cap C=B$. So $x\notin C$. Since $X$ is completely regular, $\exists f: X\to [0,1]$ such that $f$ is continuous, $f(x)=1$ and $f(C)=\{0\}$. By theorem 18.2, $f|_{Y}:Y\to [0,1]$ is continuous. Since $B\subseteq C$, we have $f|_Y(B)=f(B)\subseteq f(C)=\{0\}$. Hence $\exists f|_Y:Y\to [0,1]$ such that $f|_Y$ is continuous, $f|_{Y}(x)=f(x)=1$ and $f|_Y (B)=\{0\}$. Is this proof better version of Munkres proof? Munkres used theorem 17.4, $(\overline{B})_Y =\overline{B}\cap Y$. Which is special case of theorem 17.2.
I think, there is a typo, $f_i(X_{\alpha_i}-U_{\alpha_i})$ instead of $f_i(X-U_{\alpha_i})$. Munkres’ claim that $\phi_i:X\to [0,1]$ defined by $\phi_i(x)=f_i(\pi_{\alpha_i}(x))$ vanishes outside $\pi_{\alpha_i}^{-1}(U_{\alpha_i})$, i.e. $\phi_i( \prod X_\alpha -\pi_{\alpha_i}^{-1}(U_{\alpha_i}))=\{0\}$. Question: (1) How to prove $\pi_{\alpha_i}(\prod X_\alpha- \pi_{\alpha_i}^{-1}(U_{\alpha_i}))=X_{\alpha_i} -\pi_{\alpha_i}( \pi_{\alpha_i}^{-1}(U_{\alpha_i}))$? I known $\supseteq$ inclusion holds in general. (2) Munkres’ claim that $f$ vanishes outside $\prod U_\alpha$, i.e. $f(\prod X_\alpha - \prod U_\alpha)=\{0\}$. By theorem 19.5, $(\prod X_\alpha) - (\prod U_\alpha) =\bigcup_{\alpha \in J} \pi_{\alpha}^{-1}(X_\alpha \setminus U_\alpha)$. So $\phi_1 (\prod X_\alpha - \prod U_\alpha) =\phi_1 (\bigcup_{\alpha \in J} \pi_{\alpha}^{-1}(X_\alpha \setminus U_\alpha))=$$\bigcup_{\alpha \in J}\phi_1 (\pi_\alpha^{-1} (X_\alpha \setminus U_\alpha))=\bigcup_{\alpha \in J}\phi_1 (\prod X_\alpha -\pi_{\alpha}^{-1}(U_\alpha))$. Note $\phi_1(\prod X_\alpha -\pi_{\alpha_1}^{-1}(U_{\alpha_1}))=\{0\}$. Now how to show $f(\prod X_\alpha -\prod U_\alpha)=\{0\}$? (3) Can this result holds in box topology? Here I showed arbitrary product of regular space is regular in box topology.
Edit: My claim in (1), $\pi_{\alpha_i}(\prod X_\alpha- \pi_{\alpha_i}^{-1}(U_{\alpha_i}))=X_{\alpha_i} -\pi_{\alpha_i}( \pi_{\alpha_i}^{-1}(U_{\alpha_i}))$, is incorrect. The correct way to reach desired result, $\phi_i( \prod X_\alpha -\pi_{\alpha_i}^{-1}(U_{\alpha_i}))=\{0\}$, is in answer by Mateo.
 A: (0) Yes, there's a typo.
(1)

*

*$\prod X_\alpha- \pi_{\alpha_i}^{-1}(U_{\alpha_i}) = 
\pi_{\alpha_i}^{-1}\left(X_{\alpha_i} - U_{\alpha_i} \right)$;

*$f(f^{-1}(A))=A$ if $f$ is surjective.
Then
$$\pi_{\alpha_i}\left(\prod X_\alpha- \pi_{\alpha_i}^{-1}(U_{\alpha_i})\right)
= \pi_{\alpha_i}(\pi_{\alpha_i}^{-1}\left(X_{\alpha_i} - U_{\alpha_i} \right))
=X_{\alpha_i} -U_{\alpha_i}.$$
(2)

*

*Recall that $U_\alpha = X_\alpha$ unless $\alpha\notin \{\alpha_1,\ldots \alpha_n\}$.

*Let $x\notin \prod U_\alpha$. Then $x_{\alpha_i}\notin U_{\alpha_i}$ for some $1\leq i\leq n$.

*We get $\phi_i(x)=f_i(x_{\alpha_i}) = 0$. Therefore $f(x)=0$.

(3) https://mathoverflow.net/questions/209661/which-topological-properties-are-preserved-under-taking-box-products
I'm not familiar with box topology, but I'll try to prove it. The problem with box topology is that we can't define $f$ this way, because we now need to take into account all the components (in the product topology almost all components were trivial, i.e. whole space) and we can't calculate the infinite product (possibly uncountable) of numbers. I'll try with infimum function.
Let $X=\prod_{\alpha\in A} X_\alpha$, where $X_\alpha$ are completely regular. On $X$ we consider box topology. Let $b=(b_\alpha)\in X$ and a basis element $U=\prod U_\alpha$ such that $b\in U$. Let $f_\alpha\colon X_{\alpha}\to [0,1]$ be continuous such that $f_\alpha(b_\alpha)=1$ and $f_\alpha\equiv 0$ outside $U_\alpha$. Now define
$$\phi_\alpha(x) = f_\alpha(\pi_\alpha(x)),\quad f(x)= \inf_{\alpha\in A} \phi_\alpha(x).$$

*

*Of course $f(b)=\inf f_\alpha(b_\alpha)=1$.

*If $x\notin U$ then $x_\alpha\notin U_\alpha$ for some $\alpha$. Then $$\phi_\alpha(x)=f_\alpha(\pi_\alpha(x))=f_\alpha(x_\alpha)=0,$$ so $f(x)=0$. Therefore $f\equiv 0$ outside $U$.

It suffices to show the continuity of $f$. First, observe that $\phi_\alpha$ is continuous as a composition of two continuous functions. We'll show that $f^{-1}(S)$ is open for any $S$ from the subbase of the Euclidean topology.
To do it we observe that for any set $P\subset \Bbb R$:

*

*$\inf P<t \iff \exists_{p\in P}\,p<t$;

*$\inf P>t \iff \exists_{s>t}\,\forall_{p\in P}\, p>s$.

Now we are ready to prove the continuity.

*

*Let $S=(-\infty,t)$. Then
$$f^{-1}(S) = \{x\in X\,|\,\phi_\alpha(x)<t\text{ for some }\alpha\} = \bigcup_\alpha \phi_\alpha^{-1}(S),$$ which is an open set.

*Let $S=(t,\infty)$. Then
$$f^{-1}(S) = \{x\in X\,|\,\inf\phi_\alpha(x)>t\} = \bigcup_{s>t} \{x\in X\,|\,\phi_\alpha(x)>s\text{ for all }\alpha\}=\ldots$$
$$\ldots = 
\bigcup_{s>t} \{x\in X\,|\,\pi_\alpha(x)\in f_\alpha^{-1}((s,\infty))\text{ for all }\alpha\} = 
\bigcup_{s>t} \prod_\alpha f_\alpha^{-1}((s,\infty))
$$
which is an open set as a sum of basis sets.

