We can unify the cases for closed / open surjective maps in a single proof: they are quotient maps, i.e. $f^{-1}[O]$ is open in $X$ iff $O$ is open in $Y$, for all $O \subset Y$.
Standard fact: a space $X$ is locally connected iff the components of every open subspace $O$ are open (in $O$ or $X$, that's the same). This is in all the textbooks.
Now if $O \subset Y$ is open and $C \subset O$ is a (connected) component of $O$, then check that every component of $f^{-1}[C]$ is a component of $f^{-1}[O]$, using continuity of $f$.
Next, $f^{-1}[O]$ is open in $X$, so by local connectedness of $X$ we know all components of $f^{-1}[C]$ are open in it, and so $f^{-1}[C]$ is open. But then $f$ being quotient gives that $C$ is open in $O$ and you are done.
So we get a more general proof using the notion of quotient maps.
First of all, the topology $\prod_i\tau_i$ is not the product topology, but the so-called box topology. They only coincide if the familly is finite. The true product topology is generated by products of open sets $U_i\in\tau_i$ (up to here, this is the box topology), but those open sets must be $U_i=X_i$ except for finitely many $i$'s.
Second, the product topology makes all projections continuous, but this does not characterize it. The property that characterizes it is that a mapping $\ f:Y\to\prod_iX_i$ is continuous if and only if all components $f_i=\pi_i\circ f$ are continuous (note the if and only if).
Next, concerning the questions about inverse images of compact sets, this is essentially related to the notion of proper map. In absolute generality proper means universally closed, that is the mapping is closed and any extension $f\times$Id${}_Y$ is closed too (look at wiki, for instance). However technical this is, under mild restrictions this is equivalent to what you asked for: inverse images of compact sets are compact. Now given $\pi_i:X_i\times Y_i\to X_i$ (denote $Y_i=\prod_{j\ne i}X_j$) and $K\subset X_i$ compact, $\pi_i^{-1}(K)=K\times Y_i$ is compact if and only if (Thychonoff) $Y_i$ is compact, if and only (Tych again) if all $X_j$ are compact. Thus projections are proper if and only if all factors of the product are compact.
Finally suppose the factors $X_i$ compact and also Hausdorff. Consider any continuous mapping $f:X\to X_i$. Then any compact set $K\subset X_i$ is closed (by the Hausdorff assumption), hence $f^{-1}(K)$ is closed in $X$, which is compact (Tych once again). But closed in compact is compact, hence $f^{-1}(K)$ is compact. (This is just the general argument to show that a continuous mapping from a compact space to a Haussdorf one is proper.)
Best Answer
so take $y \in Y$ since $f$ is surjective there is $x \in X$ such that $f(x)=y$, so there is a compact neighborhood $U$ of $x$ , $f(U)$ is a compact subset of $Y$ and since $U$ is a neighborhood of $x$ so there is a open subset of $U$, $V$ such that $x \in V$, $f$ is a open mapping so $f(V)$ is open in $Y$ and $f(V) \subset f(U)$ such that $y \in f(V)$ so $f(U)$ is a compact neighborhood of $y$ as requested!