$\mathcal{f}:\mathbb{R}^{2}\rightarrow\mathbb{R}$ restricted to sections is continuous implies continuity Let $\mathcal{f}:\mathbb{R}^{2}\rightarrow\mathbb{R}$ such that $\mathcal{f}$ restricted to each {$x=a$} is continuous and restricted to each section {$y=b$} is continuous and monotone.Prove that $\mathcal{f}$ is continuous.
My thoughts:I tried to prove $\mathcal{f}$ is differentiable but it was a rather bad strategy.
update:corrected restriction to x=a for each restriction x=a
 A: Hint: Pick any point $(x_0, y_0)$ in the plane and a constant $\epsilon > 0$. Then there exists $\delta_1 > 0$ such that $|f(x,y_0) - f(x_0,y_0)| \le \epsilon / 2$ whenever $|x-x_0| \le \delta_1$. Now there exist $\delta_2 > 0$ such that $|f(x_0 \pm \delta_1, y) - f(x_0 \pm \delta_1, y_0)| \le \epsilon/2$ whenever $|y-y_0| \le \delta_2$. This gives $|f(x_0 \pm \delta_1,y) - f(x_0,y_0)| \le \epsilon$ for $|y-y_0| \le \delta_2$, i.e., you get the desired continuity estimate on the left and right sides of the rectangle of width $2\delta_1$ and height $2\delta_2$ centered at $(x_0,y_0)$. The same estimate for the interior now follows from monotonicity in the $x$-variable.
A: Let $(x_0,y_0)\in\mathbb{R}^2$. By changing $f$ by $g(x,y)=g(x+x_0,y+y_0)-f(x_0,y_0)$ if necessary, we can assume that $(x_0,y_0)=(0,0)$ and $f(0,0)=0$ (this is just so I don't have to type as much).
Let $\delta_1>0$ such that $|f(x,0)|\leq\epsilon$ whenever $|x|\leq\delta_1$. Now choose $\delta_2>0$ such that $|f(\delta_1,y)-f(\delta_1,0)|<\epsilon$ and $|f(-\delta_1,y)-f(-\delta_1,0)|<\epsilon$ whenever $|y|<\delta_2$.
Consider the rectangle $[-\delta_1,\delta_1]\times[-\delta_2,\delta_2]$, which contains $(0,0)$ in its interior. Suppose $|x|<\delta_1$ and $|y|<\delta_2$. Then
$$|f(\delta_1,y)|\leq|f(\delta_1,y)-f(\delta_1,0)|+|f(\delta_1,0)|\leq 2\epsilon,$$
and similarly $|f(-\delta_1,y)|\leq 2\epsilon$. Since $f$ is monotone along the line $(\cdot,y)$, and $(x,y)$ is between $(-\delta_1,y)$ and $(\delta_1,y)$, we have $|f(x,y)-f(\delta_1,y)|\leq|f(-\delta_1,y)-f(\delta_1,y)|$, so
\begin{align*}
|f(x,y)|&\leq|f(x,y)-f(\delta_1,y)|+|f(\delta_1,y)|\\
&\leq |f(-\delta_1,y)-f(\delta_1,y)|+2\epsilon\\
&\leq 6\epsilon
\end{align*}
Remark: We are doing approximations here, which works well and is quite visual. But actually, using the fact that $f$ is monotone on the line $(\cdot,y)$ yields $|f(x,y)|\leq\max(|f(-\delta_1,y)|,|f(\delta_1,y)|)\leq 2\epsilon$.
A: $\newcommand{\eps}{\varepsilon}$Hint: If $(x, y)$ and $(x_{0}, y_{0})$ are arbitrary points, then
$$
f(x, y) - f(x_{0}, y_{0})
  = \bigl(f(x, y) - f(x, y_{0})\bigr) + \bigl(f(x, y_{0}) - f(x_{0}, y_{0})\bigr).
$$
In the first term on the right, only $y$ varies; in the second, only $x$ varies.

Edit: More hint, since the epsilontics are a bit delicate.
Assume without loss of generality that $f$ is non-decreasing in $y$.
Fix $(x_{0}, y_{0})$ and  $\eps > 0$. Use continuity of $f$ in $y$ to pick $\delta_{2} > 0$ such that
$$
|y - y_{0}| < \delta_{2} \text{ implies }
  |f(x_{0}, y) - f(x_{0}, y_{0})| < \tfrac{1}{3}\eps.
$$
Now use continuity in $x$ (and the standard "minimum of two conditions" idiom) to pick $\delta_{1} > 0$ such that
$$
|x - x_{0}| < \delta_{1} \text{ implies }
  |f(x, y_{0} \pm \delta_{2}) - f(x_{0}, y_{0} \pm \delta_{2})| < \tfrac{1}{3}\eps.
$$
If $|x - x_{0}| < \delta_{1}$ and $0 \leq y - y_{0} < \delta_{2}$, then
$$
f(x, y) - f(x_{0}, y_{0})
  = \bigl(f(x, y) - f(x_{0}, y)\bigr) + \bigl(f(x_{0}, y) - f(x_{0}, y_{0})\bigr).
\tag{1}
$$
Now for the delicate part: Since $f$ is monotonic in $y$,
\begin{align*}
\bigl(f(x, y) - f(x_{0}, y)\bigr)
  &\leq \bigl(f(x, y_{0} + \delta_{2}) - f(x_{0}, y_{0})\bigr) \\
  &= \bigl(f(x, y_{0} + \delta_{2}) - f(x_{0}, y_{0} + \delta_{2})\bigr)
  + \bigl(f(x_{0}, y_{0} + \delta_{2}) - f(x_{0}, y_{0})\bigr)
\tag{2a}
\end{align*}
(increase $y$ in the first term and decrease it in the second, then use my initial hint), and
$$
\bigl(f(x_{0}, y) - f(x_{0}, y_{0})\bigr)
  \leq \bigl(f(x_{0}, y+ \delta_{2}) - f(x_{0}, y_{0})\bigr).
\tag{2b}
$$
Entirely similar estimates handle the case $-\delta < y - y_{0} < 0$.
Putting everything together, if $|x - x_{0}| < \delta_{1}$ and $|y - y_{0}| < \delta_{2}$, then
\begin{align*}
|f(x, y) - f(x_{0}, y_{0})|
  &\leq \big|f(x, y) - f(x_{0}, y)\big| + \big|f(x_{0}, y) - f(x_{0}, y_{0})\big| \\
  &\leq \big|f(x, y_{0} + \delta_{2}) - f(x_{0}, y_{0} + \delta_{2})\big|
  + \big|f(x_{0}, y_{0} + \delta_{2}) - f(x_{0}, y_{0})\big| \\
  &\qquad + \big|f(x_{0}, y+ \delta_{2}) - f(x_{0}, y_{0})\big| \\
  &< \eps.
\end{align*}
