$f| _{dense\;set}=0$ and continuous on lines $\implies f \equiv 0$ Denoting $I=[0,1]$, let $f:I^2 \to \mathbb{R}$, such that $f=0$ on a dense set $A \subseteq I^2$, i.e. $cl(A)=I^2$. 
Assume also that $f$ is continuous on horizontal and vertical lines, i.e. $\forall x_0,y_0 \in I: f(x,y_0) \in C(I),f(x_0,y) \in C(I)$.
Prove that $f$ is identically $0$.
 A: NOTIFICATION : this answer is valid for an uniform continuity on the lines, i.e. the below $\delta_x,\delta_y$ are independant of the choice of the horizontal/vertical line. 
Let $(x,y)\in I^2\setminus A$ and $\varepsilon>0$. By hypothesis, there exist $\delta_x,\delta_y>0$ such that
$$|x-x_0|<\delta_x\Longrightarrow|f(x,y)-f(x_0,y)|<\varepsilon/2\quad\quad\forall y\in I$$
and
$$|y-y_0|<\delta_y\Longrightarrow|f(x_0,y)-f(x_0,y_0)|<\varepsilon/2\quad\quad\forall x_0\in I.$$
Now, as $A$ is a dense set, we can find $(x_0,y_0)\in A$ such that
$$|x-x_0|<\delta_x,\quad |y-y_0|<\delta_y.$$
Then we have
$$|f(x,y)|=|f(x,y)-\underbrace{f(x_0,y_0)}_{=0}|\leq|f(x,y)-f(x_0,y)|+|f(x_0,y)-f(x_0,y_0)|<\varepsilon$$
As $\varepsilon$ was arbitrary, we've shown that $f(x,y)=0$. As $(x,y)\in I^2\setminus A$ was arbitrary, we've shwon that $f$ is identically zero on $I^2\setminus A$.
A: Drawing a picture next to this proof makes it much more clear (as with many proofs...)
Choose any $(a,b)\in [0,1]^{2}$ and $\varepsilon>0$.
By density of $\{f=0\}$ there is $(x_{1},y_{1})\in (a-\varepsilon,a+\varepsilon)\times(b-\varepsilon,b+\varepsilon)$ such that $f(x_{1},y_{1})=0$. By continuity on vertical lines there is $\delta_{1}$ such that $f(x_{1},y)<1/2$ for $|y-y_{1}|<\delta_{1}$, and we can take $\delta_{1}$ such that $\delta_{1}<1/2$ and $[y_{1}-\delta_{1},y_{1}+\delta_{1}]\subset (b-\varepsilon,b+\varepsilon)$.
Now repeat the construction recursively for each $n$ to find $(x_{n+1},y_{n+1})$ and $\delta_{n+1}$ such that


*

*$(x_{n+1},y_{n+1}) \in (a-\delta_{n},a+\delta_{n})\times(y_{n}-\delta_{n},y_{n}+\delta_{n})$

*$\delta_{n+1}<1/2^{n+1}$

*$[y_{n+1}-\delta_{n+1},y_{n+1}+\delta_{n+1}]\subset (y_{n}-\delta_{n},y_{n}+\delta_{n})$

*$f(x_{n+1},y)<1/2^{n+1}$ for $|y-y_{n+1}|<\delta_{n+1}$


The constructed sequences have the following properties:


*

*$\delta_{n}\rightarrow 0$

*$x_{n}\rightarrow a$ (because $\delta_{n}\rightarrow 0$)

*$y_{n}$ has a limit $\bar{y}\in [a-\varepsilon,a+\varepsilon]$, which is the unique element of $\bigcap_{n} [y_{n}-\delta_{n},y_{n}+\delta_{n}]$.

*$f(x_{n},\bar{y})\leqslant 1/2^{n}$ so that $f(a,\bar{y})=0$ by continuity on horizontal lines.


We have shown that for all $\varepsilon > 0$, there is $\bar{y}$ such that $f(a,\bar{y})=0$ and $|\bar{y}-b|<\varepsilon$. By continuity on vertical lines $f(a,b)=0$. Since $a,b$ were arbitrary, $f=0$.
