Find a function $f:X\times X\to \mathbb{R}$ such that restrictions to some sets are continuous but $f$ is not continuous. Find a function $f:X\times X\to \mathbb{R}$ such that, for every $x\in X$, $f\restriction{X\times \{x\}}$ is continuous and $f\restriction{\{x\}\times X}$ is continuous but $f$ is not continuous.
I have been thinking and I shout of functions continuous in either $\{x\}\times X$ or $X\times \{x\}$, and not continuous, but not in both.
For example, take $f:X\times X\to \mathbb{R}$ such that $f(x,y)=\frac{1}{x}$ is $x\in \mathbb{Q}$ and $f(x,y)=0$ is $x\not\in \mathbb{Q}$. This function restricted to $\{x\}\times X$ will be continuous for every $x\in X$, but not in $X\times \{x\}$.
Any help would be appreciated.
 A: One traditional example is
$\displaystyle
f(x,y) = \begin{cases}
\displaystyle\frac{xy}{x^2+y^2}, &\text{if } (x,y)\ne(0,0), \\
0, &\text{if } (x,y)=(0,0).
\end{cases}
$
A: Consider the function $f:\mathbb{R}^2\to \mathbb{R}$ such that $f(x,y)=\left\{
 \begin{array}{ll}
  \frac{xy}{x^2+y^2}  & \mbox{if } (x,y) \neq (0,0) \\
  0 & \mbox{if } (x,y)=(0,0).
 \end{array}
\right.$
First, $f$ in not continuous at $(0,0)$:
Take the sequences $(\frac{1}{n},\frac{1}{n})$ and $(\frac{1}{n},0)$. $$\lim_{n\to \infty}(\frac{1}{n},\frac{1}{n})=(0,0)$$  and $$f(\frac{1}{n},\frac{1}{n})=\frac{\frac{1}{n^2}}{\frac{2}{n^2}}=\frac{1}{2},$$ then $$\lim_{n\to \infty}f(\frac{1}{n},\frac{1}{n})=\frac{1}{2},$$ but $$f(\lim_{n\to \infty}(\frac{1}{n},\frac{1}{n}))=f(0,0)=0\neq \frac{1}{2}$$.
So $f$ in not continuous at $(0,0)$.
Now, let $k\in \mathbb{R}$ fixed, I have to prove that $f\restriction_{\{k\}\times \mathbb{R}}$ is continuous for all $y\in \mathbb{R}$. 
If $k\neq 0$, $f$ can be written as a function $\hat{f}:\mathbb{R}\to \mathbb{R}$ such that $\hat{f}(y)=\frac{ky}{k^2+y^2}$. This is a continuous function.
if $k=0$, then $f$ is the function $\hat{f}:\mathbb{R} \to \mathbb{R}$ such that $f(y)=0$. This is also a continuous function.
So $f\restriction_{\{k\}\times \mathbb{R}}$ is continuous for all $y\in \mathbb{R}$.
Because the function is "symmetric" for $x$ and $y$, then a similar proof can be made to see that $f\restriction_{\mathbb{R}\times \{k\}}$ is continuous for all $y\in \mathbb{R}$.
Hope this is correct and complete.
