For nonempty sets $A \subset M, B \subset N$, if $A \times B$ is compact, then $A$ and $B$ are compact. Consider any pair of sequences $(a_n) \subset A$ and $(b_n) \subset B.$ The sequence $((a_n),(b_n)) \subset A \times B$ is contained in $A \times B.$ Hence, there is a subsequence $(a_{f(n)}, b_{g(n)}) \subset A \times B$ whose limit $(a',b') \in A \times B.$ It follows that $(a_{f(n)}) \subset (a_n) \subset A$ and $(b_{g(n)}) \subset (g_n) \subset B,$ that is, $(a_{f(n)})$ is a subsequence of the sequence $(a_n),$ which is contained in $A,$ and $(b_{g(n)})$ is a subsequence of the sequence $(b_n),$ which is contained in $B.$ Moreover, it also follows from $(a',b') \in A \times B$ that $a' \in A$ and $b' \in B.$ Therefore, the subsequences $(a_{f(n)})$ of $(a_n) \subset A$ and $(b_{g(n)})$ of $(b_n) \subset B$ have their limits $a'$ and $b',$ respectively, in $A$ and $B,$ respectively. Hence, $A$ and $B$ are compact.
Is there something missing in this proof?
Definition of compactness in the textbook:
"A subset $A$ of a metric space $M$ is (sequentially) compact if every sequence $(a_n)$ in $A$ has a subsequence $(a_{n_k})$ that converges to a limit in $A.$
This is the only definition of compactness mentioned in the textbook.
 A: There's an assumption missing: that neither $A$ nor $B$ is empty. Otherwise, the proof fails (and the statment is false, by the way).
That argument works for metric spaces. For general topological spaces it doesn't because, in general, it is not true that a topological space is compact if and only if every sequence has a convergent subsequence.
A: It's fine as long as you are working in spaces in which sequentially compact $\Leftrightarrow$ compact, e.g metrizable spaces. But this is also true for more general spaces. Indeed, when $A\times B$ has the product topology, the maps $\pi_A: A\times B \rightarrow A$, $\pi_B: A\times B \rightarrow B$ defined as the projections are continuous. Since continuous maps send compact to compact, then $A=\pi_A(A\times B)$, $B=\pi_B(A\times B)$ are both compact.
A: You have only proved sequentially compactness.  For metric (or metrizable) spaces this is equivalent to compactness, but for general topological spaces it isn't.  However, there is an easy fix replacing sequences with nets to work with arbitrary topological spaces $M,N$.
