Assume that a binary function $f \colon \mathbb{R}^2 \rightarrow \mathbb{R}$.
For every $x_{0}, y_{0} \in \mathbb{R}$, let $$g_{y_{0}} \colon \mathbb{R} \rightarrow \mathbb{R} \\ ~~~~~~~~~~~~~~~~~x \mapsto f(x,y_{0}) \\$$ $$h_{x_{0}} \colon \mathbb{R} \rightarrow \mathbb{R} \\ ~~~~~~~~~~~~~~~~~x \mapsto f(x_{0},y) \\$$ Prove that $f$ is continuous if
(1)For every $x \in \mathbb{R}$, $g_{x}$ is continuous.
(2)For every $y \in \mathbb{R}$, $h_{y}$ is continuous.
(3)For every compact subset of $G \subset \mathbb{R}^2$, $f(G)$ is also a compact subset of $\mathbb{R}$.
Obviously, (1) and (2) don't imply that $f$ is continuous. But I don't know how to use (3). Indeed, I don't understand the useness of (3). If $f$ satisfies (1) and (2), I don't know how to add a condition to make $f$ be continuous.