Given $X$ and $Y$ topological spaces, I need to
prove that the product topology on $X \times Y$ is the finest one such that for any topological space $Z$, and continuous functions $f: Z \to X$ and $g: Z \to Y$, the function $(f\times g): Z\to X\times Y$ is continuous.
What I did was to write $f=\pi_1\circ(f\times g)$ and $g=\pi_2\circ(f\times g)$.
Then take an open set $U$ in the topology of X. Since $f$ is continuous,
\begin{equation} f^{-1}(U)=(f\times g)^{-1}( \pi_1^{-1}(U))=(f\times g)^{-1}(U\times Y) \end{equation}
is an open set in $Z$. Similarly, we get that $(f\times g)^{-1}(X\times V)$ is also an open set in Z, where $V$ is open in $Y$.
This means that we need the preimage of all sets of these forms to be open in $Z$, but $\{X\times V\} \cup \{U \times Y\}$ are a subbase for the product topology.
Is my reasoning correct? How do I prove there is no finest topology that works?