Proof verification of continuity of $f$ Question: Let $f:\mathbb{R^2} \to \mathbb{R}$ be a function such that:
(I) For all $y_0 \in \mathbb{R}$, $f(x,y_0)$ is continuous.
(II) For all $x_0 \in \mathbb{R}$, $f(x_0, y)$ is continuous.
(III) If $K\subset\mathbb{R^2}$ is compact, then $f(K)$ is compact.
Show that $f$ is continuous.
My attempt was: We shall prove that $\lim f(z_n) = f(\lim z_n)$. Take $(x_n,y_n) \in \mathbb{R^2}$ such that $(x_n,y_n) \to (x,y)$. Since $(x_n,y_n)$ is bounded, exists $K \subset \mathbb{R^2}$ compact such that $(x_n,y_n) \subset K$ and, by (III), $f(x_n,y_n)$ is bounded. By Bolzano-Weierstrass exists a subsequence convergent. Take any convergent subsequence $f(x_{n_k}, y_{n_k}) \to f(x',y')$. Note that $f(x',y') = \lim f(x_{n_k}, y')$, and, by (I), $\lim f(x_{n_k}, y') = f(x,y')$. Same argument using (II) for $y'$. Therefore $f(x',y') = f(x,y)$. Hence, since every convergent subsequence of $f(x_n,y_n)$ converge to $f(x,y)$, $\lim f(x_n,y_n) = f(x,y)$, that is, $f$ is continuous. $\blacksquare$
Is that right?
 A: Several comments:


*

*It is not enough to say that $f(x_n,y_n)$ is bounded and hence it has a convergent subsequence because then you would have to write $f(x_{n_k},y_{n_k}) \rightarrow L$ and you wouldn't a priori know that $L$ has the form $L = f(x',y')$ for some $(x',y') \in \mathbb{R}^2$ like you assume in the proof. In the way your argument is written, nothing precludes the sequence to converge to a limit outside the image of $f$. However, you know something stronger - since $f(K)$ is compact and $f(x_n,y_n) \in f(K)$, there exists a subsequence $f(x_{n_k},y_{n_k})$ that converges to an element of $f(K)$ and hence the limit is of the form $f(x',y')$ for $(x',y') \in K$. 

*Your "note that $f(x',y') = \lim f(x_{n_k},y')$" needs to be justified as this is the most important point of the proof and you rely on it heavily.

*In the end, I would write "the argument shows that every subsequence of $f(x_n,y_n)$ has a convergent subsequence that converges to $f(x,y)$ and so..." and not "Hence, since every convergent subsequence..." because, strictly speaking, this is enough (maybe $f(x_n,y_n)$ has subsequences that don't converge?).

