If $f:\mathbb{R}\to \mathbb{R}$ is continuous over the entire domain Ms is not bounded above or below, show that $f(\mathbb{R})=\mathbb{R}.$

My approach would be to say that since $f$ is continuous on $\mathbb{R}$ it must be continuous on $[a,b],\text{}a,b\in \mathbb{R}$ and using the intermediate value theorem this tells us that $f$ must take every value between $f(a)$ and $f(b)$. Now I want to argue that we can make this closed bounded interval as large as we want and the result still holds and I want to show that this implies that we can make the values of $f(a)$ as small as we like and $f(b)$ as large as we like (or the other way round) since $f$ is neither bounded below or above but I'm not sure if this argument can used to show that the image of $f$ is $\mathbb{R}$ since we switch from closed bounded intervals to an unbounded interval.

Does my argument hold to show the result?

My approach would be to say that since $f$ is continuous on $\mathbb{R}$ it must be continuous on $[a,b],\text{}a,b\in \mathbb{R}$ and using the intermediate value theorem this tells us that $f$ must take every value between $f(a)$ and $f(b)$. Now I want to argue that we can make this closed bounded interval as large as we want and the result still holds and I want to show that this implies that we can make the values of $f(a)$ as small as we like and $f(b)$ as large as we like (or the other way round) since $f$ is neither bounded below or above but I'm not sure if this argument can used to show that the image of $f$ is $\mathbb{R}$ since we switch from closed bounded intervals to an unbounded interval.

Does my argument hold to show the result?