<s>[INST] Use delta-epsilon to prove continuity of a function $$f(x,y) =\begin{cases} x\cos(1/y)   & \text{ if  }y\neq 0,\\  0 &\text{ if }x= 0.\end{cases}$$
How would I show this function is continuous (using delta-epsilon) on any point $(x,y)$ given $y$ is not $0$, as well as at the origin? 
So far I have that for all $\epsilon$ > 0 there exist $\delta$ > 0 s.t. $$|f(x,y)-0| < \epsilon$$
whenever $0 < \|(x,y)-(0,0)\| < \delta$.
Now, when $y$ is not $0$ we have $|x\cos(1/y)| \le |x||cos(1/y)|\cdots$ 
As mentioned $|\cos(1/y)|\le 1$ but this is the point at which I get stuck and have no idea how to proceed further.
Any pointers will be greatly appreciated!
 [/INST] denote the point as $(x_0,y_0)$, obviously, you need to consider two cases
Case1: $x_0=0$.
then for any $(x, y)$:
$$
|f(x,y)-f(x_0,y_0)| = \mid x\cos \dfrac {1}{y} -0\mid=\mid x\cos \dfrac {1}{y}\mid\leq \mid x\mid  \cdot \mid\cos \dfrac {1}{y}\mid \leq \mid x \mid
$$
because $\mid\cos \dfrac {1}{y}\mid\leq 1$. choose $\delta=\epsilon $, for all $\|(x,y)-(x_0,y_0)\|<\delta$, since $x_0=0$, we get 
$$
\mid x \mid<\delta =\epsilon
$$
which means $|f(x,y)-f(x_0,y_0)|<\epsilon$.
Case2: $x_0\neq 0$.
Then 
$$
\begin{align}
|f(x,y)-f(x_0,y_0)| &= \mid x\cos \dfrac {1}{y} -x_0\cos \dfrac {1}{y_0}\mid\\
&=\mid (x-x_0)(\cos \dfrac {1}{y} -\cos \dfrac {1}{y_0})+x_0 (\cos \dfrac {1}{y} -\cos \dfrac {1}{y_0})+(x-x_0)\cos \dfrac {1}{y_0}\mid\\
&\leq \mid x-x_0\mid \mid \cos \dfrac {1}{y} -\cos \dfrac {1}{y_0}\mid +\mid x_0 \mid \mid \cos \dfrac {1}{y} -\cos \dfrac {1}{y_0}\mid +\mid x-x_0\mid \mid \cos\dfrac {1}{y_0}\mid\\
&\leq \mid x-x_0\mid \mid \cos \dfrac {1}{y} -\cos \dfrac {1}{y_0}\mid +\mid x_0 \mid \mid \cos \dfrac {1}{y} -\cos \dfrac {1}{y_0}\mid +\mid x-x_0\mid\\
\end{align}
$$
the second line uses a simple identity, while the third line uses triangular inequality.
Now, by trigonometric identities
$$
\begin{align}
\mid \cos \dfrac {1}{y} -\cos \dfrac {1}{y_0} \mid &= \mid -2\sin (\dfrac {1}{2y}-\dfrac {1}{2y_0})\sin (\dfrac {1}{2y}+ \dfrac {1}{2y_0})\mid \\
&= 2 \mid \sin (\dfrac {1}{2y}- \dfrac {1}{2y_0})\mid \mid \sin (\dfrac {1}{2y}+ \dfrac {1}{2y_0})\mid\\
&\leq 2 \mid \sin (\dfrac {1}{2y}- \dfrac {1}{2y_0})\mid \\
&\leq 2 \mid \dfrac {1}{2y}- \dfrac {1}{2y_0}\mid\\
&=\mid \dfrac {y-y_0}{yy_0} \mid
\end{align}
$$
The third line comes from $\mid \sin (\dfrac {1}{2y}+ \dfrac {1}{2y_0})\mid\leq 1$, while the fourth line uses the relationship that $\mid \sin(x)\mid < \mid x\mid $ for all $x$.
choose $\delta<\dfrac {\mid y_0 \mid }{2}$, then if $\|(x,y)-(x_0,y_0)\|<\delta$, we would get $\mid y-y_0\mid<\delta$ and $\mid y\mid>\dfrac {\mid y_0 \mid }{2}$. plug it in, then
$$
\mid \cos \dfrac {1}{y} -\cos \dfrac {1}{y_0} \mid\leq \dfrac {2\delta}{y^2_0}
$$
note that $\|(x,y)-(x_0,y_0)\|<\delta$ also implies $\mid x-x_0\mid<\delta$, now we can handle
$$
\begin{align}
|f(x,y)-f(x_0,y_0)| &\leq \mid x-x_0\mid \mid \cos \dfrac {1}{y} -\cos \dfrac {1}{y_0}\mid +\mid x_0 \mid \mid \cos \dfrac {1}{y} -\cos \dfrac {1}{y_0}\mid +\mid x-x_0\mid\\
&\leq \dfrac {2\delta^2}{y^2_0}+\dfrac {2\delta \mid x_0\mid}{y^2_0}+\delta\\
&\leq \dfrac {\delta \mid y_0\mid}{y^2_0}+\dfrac {2\delta \mid x_0\mid}{y^2_0}+\delta\\
&=\delta (\dfrac {1}{\mid y_0\mid}+\dfrac {\mid x_0\mid}{y_0^2} +1)\\
&< \epsilon
\end{align}
$$
choose $\delta=\min \{\dfrac {\mid y_0\mid }{2}, \dfrac {\epsilon}{\mid y_0\mid+\dfrac {\mid x_0\mid}{y_0^2} +1} \}$, done.
</s>