A two variable limit along a "straight line" 
Consider a function defined on $\Bbb R^2$ by $$f(x,y)=\begin{cases}0 & \text{if }\;y\le 0\;\text{ or }\;y\ge x^2,\\\sin\left(\frac{\pi y}{x^2}\right) & \text{if }\;0<y<x^2.\end{cases}$$
(a) Show that $f$ is not continuous at the origin.
(b) Show that the restriction of $f$ to any straight line through the origin is continuous.

I am a little confused with (b). What do they mean by straight line? Just $y=mx$? I don't see how $f(x,mx) = \sin(\frac{\pi mx}{x^2})$ applies here? Do they just mean the coordinate axes?
 A: Observe that (b) asks us to show that restrictions of $f$ to straight lines through the origin are continuous, rather than simply continuous at the origin. I'm going to assume this wasn't a misstatement. It suffices to show that $f$ is continuous everywhere but the origin, and that restrictions to straight lines through the origin are continuous at the origin.

First, let's show that $f$ is continuous everwhere but the origin. (I'm not going to rigorously justify everything that follows. Hopefully, you'll be able to follow and/or justify everything in the first two paragraphs. Let me know if you're having trouble with any statements made in the last two paragraphs, and I'll elucidate further here or discuss it with you in chat.)

Note that our "pieces" are divided up along the boundary curves $y=0$ and $y=x^2$. The plane is split into $4$ pairwise-disjoint regions by these boundary curves, and every non-origin point in the plane lies in exactly one of these regions, or on exactly one of the boundary curves. The only point that lies on the boundary of more than two of these regions (in fact, of all of these regions) is the origin. (Draw a picture to confirm these statements.)
Obviously, the constant $0$ function is continuous everywhere, so in particular, $f$ is continuous on the two regions $\bigl\{(x,y)\in\Bbb R^2:y<0\bigr\}$ and $\bigl\{(x,y)\in\Bbb R^2:y>x^2\bigr\}$. Also, the function $g:\Bbb R^{>0}\times\Bbb R\to\Bbb R$ given by $g(x,y)=\frac{\pi y}{x^2}$ is continuous by basic continuity results, so since the sine function is continuous on $\Bbb R$, then the composition $\sin\bigl(g(x,y)\bigr)=\sin\left(\frac{\pi y}{x^2}\right)$ is continuous on $\Bbb R^{>0}\times\Bbb R$. In particular, then $f$ is continuous on the two regions $\bigl\{(x,y)\in\Bbb R^2:x<0\text{ and }0<y<x^2\bigr\}$ and $\bigl\{(x,y)\in\Bbb R^2:x>0\text{ and }0<y<x^2\bigr\}$. All that remains, then, is to show that $f$ is continuous at each non-origin point on the boundary curves.
Suppose that $y=0$ and $x\neq 0$. Then $\sin\bigl(\frac{\pi y}{x^2}\bigr)=\sin 0=0$, so our two rules agree along the positive and negative $x$-axes. Consequently, since $f$ is continuous on each of the regions $\bigl\{(x,y)\in\Bbb R^2:y<0\bigr\}$, $\bigl\{(x,y)\in\Bbb R^2:x<0\text{ and }0<y<x^2\bigr\}$ and $\bigl\{(x,y)\in\Bbb R^2:x>0\text{ and }0<y<x^2\bigr\}$, then $f$ is continuous on the union of these regions with the positive and negative $x$-axes. That is, $f$ is continuous on the region $\bigl\{(x,y)\in\Bbb R^2:y<x^2\bigr\}$.
Now suppose that $y=x^2$ and $x\neq 0$. Then $\sin\left(\frac{\pi y}{x^2}\right)=\sin \pi=0$, so our two rules agree along the boundary curve $y=x^2$ (except at the origin, where one of the rules is undefined). Consequently, since $f$ is continuous on each of the regions $\bigl\{(x,y)\in\Bbb R^2:y>x^2\bigr\}$, $\bigl\{(x,y)\in\Bbb R^2:x<0\text{ and }0<y<x^2\bigr\}$ and $\bigl\{(x,y)\in\Bbb R^2:x>0\text{ and }0<y<x^2\bigr\}$, then $f$ is continuous on the union of these regions with $\bigl\{(x,y)\in\Bbb R^2:x\neq0\text{ and }y=x^2\bigr\}$. That is, $f$ is continuous on the region $\bigl\{(x,y)\in\Bbb R^2:y>0\bigr\}$. Therefore, since $f$ is continuous on $\bigl\{(x,y)\in\Bbb R^2:y<x^2\bigr\}$ by the work in the previous paragraph, then $f$ is continuous on the union of $\bigl\{(x,y)\in\Bbb R^2:y<x^2\bigr\}$ and $\bigl\{(x,y)\in\Bbb R^2:y>0\bigr\}$. That is, $f$ is continuous on the region $\bigl\{(x,y)\in\Bbb R^2:(x,y)\neq(0,0)\bigr\}$, as desired.


Now, we show that the restrictions of $f$ to straight lines through the origin are continuous at the origin. (I'll be somewhat more rigorous, here, but again, let me know if you've got questions.) Note that almost every straight line through the origin is covered by the $y=mx$ case. The only one left is the vertical line $x=0$.

Observe that $f(0,y)=0$ for all $y$ and $f(x,0)=0$ for all $x$ (check that with the definition of $f$)--that is, $f$ is $0$ at every point on the coordinate axes--so $f$ restricted to these axes will be readily continuous at the origin.
The only remaining cases to check are the restrictions of $f$ to lines $y=mx$ with $m\neq 0$. We need to show that as we approach the origin along any such line, the value of $f$ approaches $f(0,0)=0$. Put another way, for $m\neq 0$, we must show that $\lim\limits_{x\to 0}f(x,mx)=0$. I'll use an $\epsilon$-$\delta$ approach.
Before we proceed, let's visualize what's going on. Go back to the picture you drew earlier. Note that any non-vertical, non-horizontal line through the origin will necessarily lie in one of the regions $\bigl\{(x,y)\in\Bbb R^2:y<0\bigr\}$ or $\bigl\{(x,y)\in\Bbb R^2:y>x^2\bigr\}$ when $x$ is sufficiently close to the origin (that is, when $0<|x-0|<\delta$ for some appropriately chosen $\delta>0$). In these regions, $f$ is identically $0$, so whenever $(x,mx)$ lies in one of those regions, we have $|f(x,mx)-0|=|0-0|=0<\epsilon$ for any $\epsilon>0$. That's going to make our job 
  much easier.
Take any $m\neq 0$ and any $\epsilon>0$. To show that $\lim\limits_{x\to 0}f(x,mx)=0$, we must find some $\delta>0$ such that whenever $0<|x-0|<\delta$, we have $|f(x,mx)-0|<\epsilon$. It suffices to find $\delta>0$ such that for all $0<|x-0|<\delta$ we have $(x,mx)$ lying in one of the regions $\bigl\{(x,y)\in\Bbb R^2:y<0\bigr\}$ or $\bigl\{(x,y)\in\Bbb R^2:y>x^2\bigr\}$, since by our visualization discussion in the previous paragraph, we have $|f(x,mx)-0|=0<\epsilon$ whenever $(x,mx)$ lies in one of those regions.
Now, "half" of the line $y=mx$ lies completely below the $x$-axis, and there, the restriction of $f$ is identically zero. Hence, we need only concern ourselves with the portion of $y=mx$ lying above the $x$-axis, and show that $(x,mx)$ lies in the region $\bigl\{(x,y)\in\Bbb R^2:y>x^2\bigr\}$ for $x$ sufficiently close to $0$ such that $mx>0$--that is, we need to find $\delta$ such that $mx=y>x^2$ for appropriately-signed $x$ such that $0<|x|<\delta$.
In order for $mx>0$, we need $m$ and $x$ to have the same sign. If they're both positive, then $m=|m|$ and $x=|x|$. If they're both negative, then $m=-|m|$ and $x=-|x|$. In either case, we have $mx=|m||x|$. This reduces our problem to finding some $\delta>0$ such that $|m||x|=y>x^2=|x|^2$ whenever $0<|x|<\delta$--the sign of $x$ no longer matters! Observe that $|m||x|>|x|^2$ implies that $|x|>0$, and dividing both sides of the inequality by $|x|$ gives us $|m|>|x|$. On the other hand, it's clear that if $|x|>0$ and $|m|>|x|$, then $|m||x|>|x|^2$. Thus, $|m||x|>|x|^2$ if and only if $0<|x|<|m|$, so since we chose $m\neq 0$, then putting $\delta=|m|>0$, we have $|m||x|>|x|^2$ whenever $0<|x|<\delta$, as desired.

A: Yes, set $y=mx$.  Then, $\sin(\frac{\pi y}{x^{2}})=\sin(\frac{m\pi x}{x^{2}})$.  This applies because there are functions of multiple variables which are continuous through the origin on a restriction to lines but not in general.
