Prove/disprove that $f : (0 , \infty) \rightarrow \mathbb R$ , $f(x) = x \sin x$ is onto I need to find whether the function $f : (0 , \infty) \rightarrow \mathbb R$ ,  $f(x) = x \sin x$ is onto or not.
Here is my approach: $f$ is an elementary function, and therefore continuous. It is continuous everywhere because it is defined everywhere in $\mathbb R$. Now, I think the function has no limit. It diverges and is not bounded. I am not sure how to "prove" it mathematically and formally. But because it is unbounded (neither from above or below), then for every $y$, there exists $x_1$ such that $f(x_1) < y$. Similiarly, there exists $x_2$ such that $f(x_2) > y$. Hence $f(x_1) < y < f(x_2)$. Again, $f$ is continuous, then by the intermediate value theorem, for every such $y$ there must exist $x_0$ such that $f(x_0) = y$. Therefore, the function $f$ is onto.
But I think there is a flaw in my proof, because the intermediate value theorem requires a closed interval. How can I fix this?
Is this approach valid and correct? If it is, I am struggling in writing in in formal, mathematical writing, specifically in proving it is not bounded (from both above and below), and that it has no limit (not even an infinite one)
 A: There isn't really a flaw in your proof, just a missing piece. One you correctly identified, and that is that the IVT needs a closed interval. But you can easily find that interval. In particular, if $x_1<x_2$, then you can use $[x_1,x_2]$, otherwise, you can use $[x_2, x_1]$. this will always be an interval, since $x_1=x_2$ is impossible.

In other words, to be perfectly rigorous, you can, after finding $x_1, x_2$, define first $I=[\min\{x_1,x_2\}, \max\{x_1,x_2\}]$, and then observe the function $f_{I}$ (i.e., the function $f$, constricted to the interval), and apply IVT on that function. This gives you the value of $x$ such that $f_I(x)=y$, and therefore, $f(x)=y$.

Furthermore,

*

*proving that the function is not bounded above should be relatively simple by just looking at $f(x)$ for $x=\frac\pi2, \frac\pi2+2\pi,\frac\pi2+4\pi$. From those three values, it should be clear how to create a sequence $x_n$ such that $f(x_n)$ diverges to $\infty$.

*Proving that the function is not bounded below should be similar.

*From 1 and 2, it already follows that the function has no limit, since that would imply it is bounded.

A: Roughly:
Given a large $n\in\mathbb{N}$:
$f(2n\pi+\frac{\pi}{2})=(2n\pi+\frac{\pi}{2})\sin(2n\pi+\frac{\pi}{2})=2n\pi+\frac{\pi}{2}$
$f(2n\pi-\frac{\pi}{2})=(2n\pi-\frac{\pi}{2})\sin(2n\pi-\frac{\pi}{2})=-(2n\pi-\frac{\pi}{2})=\frac{\pi}{2}-2n\pi$
$f$ is continuous, so it's image must contain $(\frac{\pi}{2}-2n\pi,\space 2n\pi+\frac{\pi}{2})$ the region covered by $f$ in the interval of length $\pi$ centered at $2n\pi$.
So for arbitrarily large values of $n$ the image of $f$ can contain arbitrarily large regions of $\mathbb{R}$ covering arbitrarily large regions both above and below the $x$-axis.
