# Discontinuous functions that are continuous on every line in $\bf R^2$

This is exercise 7 from chapter 4 of Walter Rudin Principles of Mathematical Analysis, 3rd edition. (Page 99)

Define $f$ and $g$ on ${\bf R}^2$ by: $$f(x,y) = \cases {0,&if (x,y)=(0,0)\\ xy^2/(x^2+y^4) &otherwise}$$

$$g(x,y) = \cases {0,&if (x,y)=(0,0)\\ xy^2/(x^2+y^6) &otherwise}$$

Prove that:

1. $f$ is bounded on ${\bf R}^2$
2. $g$ is unbounded in every neighborhood of $(0,0)$
3. $f$ is not continuous at $(0,0)$
4. Nevertheless, the restrictions of both $f$ and $g$ to every straight line in ${\bf R}^2$ are continuous!

This is one of the few specific problems I remember from my university career, which ended some time ago. I remember it because I toiled over it for so long and when I finally found the answer it seemed so simple.

-

1. Consider $0\le {(x\pm y^2)}^2 = x^2 \pm 2xy^2 + y^4$, so $\pm 2xy^2\le x^2+y^4$, and $(\pm2)f(x,y) = (\pm 2){xy^2\over x^2+y^4}\le 1$ since $x^2+y^4$ is non-negative. Taking the negative sign gives $f(x) \ge-\frac 12$ and taking the positive sign gives $f(x)\le\frac12$.

2. Let $B$ be given, and consider the value of $g$ at the point $((1/3B)^{-3}, (1/3B)^{-1})$. At this point $g$ takes the value $\frac{1\vphantom{(1/3B)^{-5}}}{2\vphantom{(1/3B)^{-6}}}\frac{(1/3B)^{-5}}{(1/3B)^{-6}} = {\vphantom{(1/3B)^{-5}}3B\over \vphantom{(1/3B)^{-5}}2}$, which is strictly larger in value than the given $B$.

3. Consider the restriction of $f$ to the semiparabola $P=\{(y^2, y), y>0\}$. $f$ is easily seen to have the constant value $\frac12$ everywhere on $P$, which includes points arbitrarily close to the origin. But $f(0,0) = 0$, so $f$ is not continuous at $(0,0)$.

4. $f$ and $g$, being rational functions with nonzero denominator, are continuous everywhere except at the origin, so their restrictions to lines that do not pass through the origin must be continuous. We therefore need only consider lines through the origin.

Every line through the origin is either the $y$-axis, with $x=0$, or has $y=mx$ for some $m$. We want to show that each of these restrictions takes values close to 0 in the vicinity of the origin, to agree with $f(0,0) = g(0,0) = 0$.

The restriction of $f$ to the $y$-axis is the constant function $f(0,y) = 0/y^6 = 0$ everywhere except at the origin, which agrees with $f(0,0)=0$, so $f$ is continuous on this line; $g$ is similarly zero everywhere on the $y$-axis.

For other lines $y=mx$, we get $f(x,mx) = \frac{m^2x^3}{x^2+m^4x^4} = \frac{m^2x}{1+m^4x^2}$, and it is easy to see that $\lim_{x\to0} f(x,mx) = 0$, since the numerator goes to zero and the denominator to 1. $g(x,mx)$ is similar: $\lim_{x\to0}g(x,mx) = \lim_{x\to0}\frac{m^2x^3}{x^2+m^6y^6}= \lim_{x\to0}\frac{m^2x}{1+m^6y^4} = 0$.

I remember I dealt with sections 1 and 4 quickly, but then suffered over section 3 for hours before I hit upon the idea of looking at the parabola $P$. After this, section 2 was easy, because the idea is basically the same: look at the restriction of $g$ to the set $\{(y^3,y), y\in{\bf R}\}$.

-
What else can I learn from this? I did not hand in most of my analysis homework that semester, and my professor quite reasonably told me that if I wanted to pass, I had better hand it in. So I was doing a semester of analysis homework in a day or two, and was under a lot of time pressure. Had I been able to sit and let the problem marinate in my mind for a few days, probably the parabola would have occurred to me spontaneously. But I had squandered that opportunity. Moral of the story: do not leave all your analysis homework until the last week of classes. –  MJD Jul 24 '12 at 21:45
Note to self: (2) needs elaboration. You need to show that for any given neighborhood of $(0,0)$, for any given $B$, there is a point $p$ in the neighborhood at which $g(p)>B$. –  MJD Jul 25 '12 at 12:22
For (3), you might notice that for $(x,y) \ne (0,0)$, $f(x,y) = xt/(x^2 + t^2)$ where $t = y^2$, and for any given $2R^2 = x^2 + t^2$ you can maximize $f(x,y)$ by taking $x=t=R$, getting $f(R,\sqrt{R}) = R^2/(R^2 + R^2) = 1/2$.