# Continuity and differentiation of $x^2 + y ^2$

Let $h : \mathbb{R}^2 \rightarrow \mathbb{R}$ be a function defined by $$h(x,y) =\begin{cases} x^2 + y^2 & : (x,y) \in \mathbb{Q} \times \mathbb{Q} \\[1ex] 0 & : \mbox{otherwise}\end{cases}$$

Show that $h$ is continuous only at $(0,0)$, and differentiable there.

I can show the continuity of $h$ at $(0,0)$. Also, I can show the discontinuity of $h$ at rational pair which is not $(0,0)$. However, I cannot show the discontinuity of other points. Also, the differentiation. Could anyone give a hint ?

If $(x_0,y_0)\neq(0,0)$ then in a small disk with centre in $(x_0,y_0)$ there are numbers greater than some $\varepsilon$.
The discontinuity at $(a,b)\in{\Bbb R}\times{\Bbb R}\setminus{\Bbb Q}\times{\Bbb Q}$ is easy: take a sequence $(x_n,y_n)\in{\Bbb Q}\times{\Bbb Q}$ s.t. $(x_n,y_n)\to(a,b)$. About the differentiability: only is possible at $(0,0)$ (why?). Start studying the partial derivatives at $(0,0)$.
It's a quite simple argument.   Every rational coordinate pair $(x,y)$ will be adjacent to points with an irrational ordinate.   Thus the equation with be discontinuous at every rational ordinate pair where $h(x,y)\neq 0$.