What are the conditions so that the function defined on the product space $X\times Y$
$f: X \times Y\rightarrow \mathbb{Z}$ is continuous. For example, is there a condition that says that if any restriction on $X \times\{y_0\}$ or $\{x_0\}\times Y $ is continuous, then $f$ is continuous? Are there other conditions if we deal with metric spaces ?
There is no such a simple condition as that. Consider the map$$\begin{array}{rccc}f\colon&\mathbb{R}^2&\longrightarrow&\mathbb R\\&(x,y)&\mapsto&\begin{cases}\frac{xy}{x^2+y^2}&\text{ if }(x,y)\neq(0,0)\\0&\text{ otherwise.}\end{cases}\end{array}$$Then $f$ is discontinuous, but each map $x\mapsto f(x,y_0)$ and $y\mapsto f(x_0,y)$ is continuous.