Differentiability and continuity of a trig function Here's a problem I'm having a lot of trouble with:


  We have the following function:
  
  $f(t) = t^2\cos(\dfrac{1}{t})$ for $t \neq 0, f(t) = 0$ for $t = 0$.
  
  
  Show $f$ is continuous everywhere, use the squeeze theorem for $t=0.$
  Show $f$ is differentiable in $ t\neq 0$, and find the derivative $f'(t)$.
  Show (using the definition of differentiability: $f'(t) = \lim_{h \to 0}\dfrac{f(t+h) - f(t)}{h}$) that $f$ is differentiable in $t=0$ and find the derivative $f'(0)$. Show that the derivative $f'$ is not continuous in $0$. 
  Look at $f$ on the domain $[0, \infty]$. Show that $f$ has no local maximum or minimum in the boundary point $0$. You can do this by showing that for every number $a&gt;0$ there are values with $0&lt;t&lt;a$ for which $f(t) &gt;0$ and also values $t$ with $0&lt;t&lt;a$ for which $f(t) &lt; 0$.
  


Here's my attempt (and my difficulties) at these:


I don't exactly know how to show that a function is continuous everywhere, but from what I looked up online this is what I tried:


$t^2\cos(\dfrac{1}{t})$ has a domain $\mathbb{R}$, except at $t=0$, where it is undefined. However, we have $f(0) = 0$, so to show $f(t)$ is continuous at $t=0$ we have to show that $\lim_{t \to 0} f(t) = f(0) = 0$. We can do this by the squeeze theorem:

On the interval $[-1,1]$ we have $$-1 \leq \cos(\dfrac{1}{t}) \leq 1$$   $$-t^2 \leq t^2\cos(\dfrac{1}{t}) \leq t^2$$ 

We know that $\lim_{t \to 0} -t^2 = 0$, and  $\lim_{t \to 0} t^2 = 0$, so  $\lim_{t \to 0} t^2\cos(\dfrac{1}{t}) = 0$, by the squeeze theorem.


Here my biggest confusion lies in the fact that you have to "show" that $f$ is differentiable for $t \neq 0$, before actually differentiating it. This implies that the two are not equal to each other, which I didn't expect. My logic tells me that if you're able to find a function's derivative, you've shown that it exists. But I think what they want here is for you to find the derivative using the following method:


At $ t \neq 0$, we have $f(t) = t^2\cos(\dfrac{1}{t})$. This function is differentiable if the following limit exists: $$\lim_{h \to 0}\dfrac{(t+h)^2\cos(\dfrac{1}{t+h}) - t^2\cos(\dfrac{1}{t})}{h}$$

Sadly, I don't know how to evaluate this limit, and you're not allowed to use L'Hospital because we haven't had that in class yet. Would anyone know how to do this using more "elementary" methods (meaning mostly algebraic stuff)?

Of course, I can find the derivative using traditional means, it is $2t\cos(\dfrac{1}{t}) + \sin(\dfrac{1}{t})$, but I don't know if that's sufficient because of the way the question is phrased. 


The first part of this question is a mystery to me, here's what I tried: 


Use the definition of differentiability, and fill in $t=0$ in the equation. We get $$ f'(0) = \lim_{h \to 0}\dfrac{h^2\cos(\dfrac{1}{h}) }{h}$$ 

Of course this makes no sense, because we're dividing by zero and stuff, and even if we remove that term as I did above, the limit still doesn't exist. So I have no clue how to tackle this problem otherwise. As for the continuity of $f'$ in 0:

$ \lim_{t \to 0} 2t \cos(\dfrac{1}{t}) + \sin(\dfrac{1}{t})$ doesn't exist, hence it is not continuous at $0$. 


I understand this conceptually, but I have no idea how to tackle it. I understand that as $t$ goes to $0$, that the amplitude of $t^2\cos(\dfrac{1}{t})$ goes to $0$ because $t^2$ goes to $0$ and I understand that the period will also go to $0$ because $\dfrac{1}{t}$ goes to infinity. But I don't know how to prove that there will always exist a number arbitrarily close to $t=0$ for which $f(t)&gt;0$ or $f(t)&lt;0$.
A partial answer. First, regarding your confusion in step (2):

The product rule and the chain rule are not just formulas, but also logical statements:


If $f$ and $g$ are differentiable on an interval $I$, then their product $fg$ is differentiable on $I$. (And its derivative is given by the following formula: ...)
If $f$ is differentiable on an interval $J$, and $g$ is differentiable on an interval $I$, and $g$ maps $I$ into $J$, then the composition $f \circ g$ is differentiable on $I$. (And its derivative is given by the following formula: ...)


Now you can argue like this: the function $x(t)=1/t$ is differentiable on interval $I=\{t&gt;0\}$ and maps $I$ into the interval $J=\{x&gt;0\}$, and $\cos x$ is differentiable on $J$; hence the composition $\cos(1/t)$ is differentiable on $I$. And $t^2$ is differentiable on $I$, hence the product $t^2 \cos(1/t)$ is differentiable on $I$. Similarly for the interval $\{ t&lt;0 \}$. Q.E.D.

In practice, of course, this kind of argument works for any function where you are actually able to compute its derivative using the product and chain rules, so usually one doesn't bother to write it out. And it's perfectly fine for you to compute the derivative using the rules in this kind of exercise; there is no need to fall back to the definition in step (2) (but in step (3) you will need to do that, of course).

Regarding (3):

The limit of
$\frac{h^2\cos(1/h) }{h}$ (as $h \to 0$) is zero since you can write the expression as
$$
\underbrace{h}_{\to 0} \cdot \underbrace{\cos(1/h)}_{\text{bounded}}
$$
(the cosine of anything is always between $-1$ and $+1$),
and there's a theorem about limits that says that if $f\to 0$ and $g$ is bounded, then $fg\to 0$.
For (2) use the Chain Rule:

$$\left(t^2\cos\frac1t\right)'=2t\cos\frac1t+t^2\left(-\frac1{t^2}\right)(-\sin\frac1t)=2t\cos\frac1t+\sin\frac1t$$

For (3) use the definition given there:

$$\frac{f(t)-f(0)}t=t\cos\frac1t\xrightarrow[t\to 0]{}0$$

the derivative function isn't continuous at $\;t=0\;$ since $\;\lim_{t\to 0}\sin\frac1t\;$ doesn't exist.

For (4) just show that there arbitrarily many points in any neghborhood of zero where $\;\cos\frac1t&gt;0\;$ and many with $\;\cos\frac1t&lt;0\;$

By the way, note that (1) now follows from (2)+(3) since a differentiable function is continuous.