So if I understand correctly, what you want is a proof of the
Theorem: Let $\left\{ f_i \colon X \to Y_i \mid i \in I\right\}$ a family of maps, where the $Y_i$ are topological spaces, and $X$ is a set. If $\tau_1$ and $\tau_2$ are topologies on $X$ with the property that a map $g \colon (Z,\tau_Z) \to (X,\tau_k)$ is continuous if and only if $f_i \circ g \colon (Z,\tau_Z) \to (Y_i,\tau_{Y_i})$ is continuous for all $i\in I$, then $\tau_1 = \tau_2$.
Proof: Since $\operatorname{id} \colon (X,\tau_k) \to (X,\tau_k)$ is continuous, it follows that $f_i \colon (X,\tau_k) \to (Y_i,\tau_{Y_i})$ is continuous for all $i\in I$, for $k \in \{1,2\}$. Choosing $(X,\tau_2)$ for $(Z,\tau_Z)$ and $g = \operatorname{id}$ in the universal property for $\tau_1$, we find that $g \colon (X,\tau_2) \to (X,\tau_1)$ is continuous, since $f_i \circ g = f_i \colon (X,\tau_2) \to (Y_i,\tau_{Y_i})$ is continuous for all $i\in I$ by the above. Hence $\tau_1 \subset \tau_2$. Swapping the roles, we obtain $\tau_2 \subset \tau_1$, and thus $\tau_1 = \tau_2$.
That shows that the universal property characterises the initial topology uniquely - if it exists.
It remains to see that a topology with the universal property exists. If such a topology exists, it must be the coarsest topology with respect to which all $f_i$ are continuous, hence it must be the topology $\tau$ that has
$$\mathcal{S} = \bigcup_{i\in I}\left\{ f_i^{-1}(U) : U \in \tau_{Y_i}\right\}$$
as a subbasis.
We must see that $\tau$ has the universal property. We note that a map $g \colon (Z,\tau_Z) \to (X,\tau)$ is continuous if and only if $g^{-1}(S)$ is open for all $S \in \mathcal{S}$ (every open set is a union of finite intersections of such sets, hence the preimage of an open set is then a union of finite intersections of open sets, which is open). If $g$ is continuous, then $f_i \circ g$ is a composition of continuous maps, hence continuous, for all $i\in I$. Conversely, if $f_i \circ g$ is continuous for all $i\in I$, and $S\in \mathcal{S}$, say $S = f_{i_0}^{-1}(U_0)$ for an open $U_0 \subset Y_{i_0}$, then
$$g^{-1}(S) = g^{-1}\left(f_{i_0}^{-1}(U_0)\right) = (f_{i_0}\circ g)^{-1}(U_0)$$
is open. Thus $g$ is continuous, and we have seen that $\tau$ has the universal property, so the existence is established.
Now it is easy to see that the topological product of spaces $X_i$ - the Cartesian product $X = \prod\limits_{i\in I} X_i$ endowed with the initial topology $\tau$ with respect to the projections $\pi_i \colon X \to X_i$ - is a product in the category $\mathbf{Top}$.
Given a topological space $(Z,\tau_Z)$ and a family of continuous maps $f_i \colon Z \to X_i$, since the Cartesian product is a product in the category $\mathbf{Ens}$ of sets (you may prefer to call it $\mathbf{Set}$, but I had too Bourbakist teachers for that), there is a unique map $f \colon Z \to X$ with $f_i = \pi_i \circ f$ for all $i\in I$. But, by assumption, $f_i = \pi_i\circ f$ is continuous, hence by the universal property of the product topology, $f$ is indeed continuous, i.e. a morphism in $\mathbf{Ens}$. The uniqueness follows by applying the forgetful functor $\mathbf{Top}\to\mathbf{Ens}$.
Best Answer
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.)