Let $(X_\alpha)_{\alpha\in I}$ a collection of non-empty topological spaces.
Denote $X:=\prod_{\alpha\in I}X_\alpha$, with $\tau$ - its topology.
Given that: for every topological space $Y$ and $f:Y\to X$, ($f$ is continuous) iff ($\forall \alpha\in I: \pi_\alpha\circ f$ is continuous ).
Where $\pi_\alpha$ is the projection from X to the $\alpha$ coordinate.
Prove $\tau$ is the product topology.
My thoughts:
Denote the product topology $\tau_p$
Choose $f=Id:(X,\tau_p)\to (X,\tau)$
Let $V_\alpha\subseteq X_\alpha$ be an open set, hence $(\pi_\alpha\circ f)^{-1}(V_\alpha)=\pi_\alpha^{-1}(V_\alpha)=V_\alpha\times\prod_{\beta\neq \alpha} X_\beta\in\tau_p$
so $Id$ is continuous and $\tau\subseteq\tau_p$.
I cannot figure the other direction, the given argument only discusses a function from Y to X, and not the other way around, so I cannot somehow conclude (can I?) that $Id:(X,\tau)\to(X,\tau_p)$ is continuous...
please help :)