Find $\sup$ and $\inf$ of $x\sin(\frac{1}{x})$ on $(0,\infty)$.
I found an example.
Example: Let $f(x)=x\sin(\frac{1}{x})$. We are interested in its behaviour for $x\geq1$. $f'(x)=\sin(\frac{1}{x})-\frac{1}{x}\cos(\frac{1}{x})$. $f''(x)=-\frac{1}{x^3}\sin(\frac{1}{x})$, and this is negative for any $x\geq1$. Then, $f'$ is decreasing. But $\lim_{x\rightarrow\infty}f'(x)=0$. Then $f'(x)>0$, for all $x\geq1$. So $f$ is increasing on $[1,\infty)$. Therefore the sequence $n\sin(\frac{1}{n})$ is increasing for all $n\geq1$. Therefore $$\inf n\sin(\frac{1}{n})=1\cdot\sin(\frac{1}{1}) = \sin(1).$$ $$\sup n\sin(\frac{1}{n})=\lim_{n\rightarrow\infty}n\sin(\frac{1}{n})=\lim_{n\rightarrow\infty}\frac{\sin(\frac{1}{n})}{\frac{1}{n}}=1.$$
I understood that the above example is when $x$ is more than $1$. However, I have to find inf and sup in the interval $(0,\infty)$, so I have to find inf and sup in the interval $(0,1)$. But I don't know what to do. I need some help.
hint
We know that
$$(\forall X>0)\;\; \sin(X)<X$$
So $$(\forall x>0)\;\;x\sin(\frac 1x)<\color{red}{1}$$
As you said
$$\lim_{n\to+\infty}n\sin(\frac 1n)=\color{red}{1}$$
thus $$\sup_{x>0}f(x)=\color{red}{1}$$
On the other hand,
$$(\forall x>0)\;\; -x\le f(x)\le x$$ the curve of $ f $ intersects the line $ y=-x $ when
$$\sin(\frac 1x)=-1 \text{ or } x=\frac{1}{\frac{3\pi}{2}+2k\pi}$$ so $$\inf_{x>0}f(x)=-\frac{2}{3\pi}\approx -0.2$$