If $A\times B$ is countable, then $A$ is countable and $B$ is countable? If $A\times B$ is countable, then $A$ is countable and $B$ is countable?
The reverse is true but is there a counter example to above statement(except A or B empty set)? I couldn't find a mapping between $\mathbb N$ and $A\times B$ to prove this.
 A: If $A, B\neq \varnothing$, then $A\times B$ countable $\iff$ $A, B$ countable.
A proof of $\implies$ might make an injection $A\to A\times B$ by fixing a $b\in B$ (which is possible since $B\neq\varnothing$) and map any $a\in A$ to $(a, b)$, thus showing $|A|\leq |A\times B|$. Then do the same for $B\to A\times B$.
A: Suppose neither $A$ nor $B$ are empty and suppose you have a mapping $h: \mathbb{N} \to A \times B$.
We can show that $|A| \leq |\mathbb{N}|$ by defining the function $f(a,b) = a$ and writing this surjective mapping:
$$f(h(n)): \mathbb{N} \to A$$.
To show $B$ is also countable, adapt $f$ to $f(a,b) = b$.
A: If $A\times B$ is countable and $a_0\in A$ and $b_0\in B$ then there are injective functions $A\to A\times B$ and $B\to A\times B$ prescribed by $a\mapsto\langle a,b_0\rangle$ and $b\mapsto\langle a_0,b\rangle$ respectively.
Their existence implies that $A,B$ are both countable if $A\times B$ is countable. The first under extra condition that $B\neq\varnothing$ and the second under extra condition that $A\neq\varnothing$.
The injectivity ensures that the domain has the same cardinality as the image and in both cases the image is a subset of a countable set, hence is countable itself.
