Intermediate value theorem - show $ f (\mathbb{R} )=\mathbb{R} $. If $f:\mathbb{R} \rightarrow \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], \ 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?
 A: A little bit cleaner argument:
Suppose $c\in\mathbb R$. We will show that there exists $x\in\mathbb R$ with $f(x)=c$
$f$ is not bounded below, so there exists $a\in\mathbb R$ such that $f(a)<c$
$f$ is not bounded above, so there exists $b\in\mathbb R$ such that $f(b)>c$
Now $f$ is continuous on $[a,b]$ (or $[b,a]$ if $b<a$) and $c\in(f(a),f(b))$, so by intermediate value property there exists $x\in(a,b)$ (or $(b,a)$) with $f(x)=c$
A: You just need to exploit the fact that $f$ is unbounded. Since $f$ is unbounded (in both directions) for any $M>0$ there is some $x_1\in\mathbb{R}$ such that $f(x_1)\geq M$ and some $x_2\in\mathbb{R}$ such that $f(x_2)\leq -M$. Where? Who cares. By the intermediate values property, $f$ attains every value between $-M$ and $M$ on the interval with endpoints $x_1$ and $x_2$. Since $M$ is arbitrary, we are done.
A: By definition you have that for all $x \in \mathbb{R}$ there's an $y \in \mathbb{R}$ such that $f(x) = y$. You basically have to prove the opposite, namely for each $y \in \mathbb{R}$ there's an $x \in \mathbb{R}$ such that $f(x) = y$. Because $f$ is unbounded there are $a_y,b_y$ such that $f(a_y) \leq y \leq f(b_y)$. Because of the continuity $f^{-1}([f(a_y),f(b_y)])$ is a closed $A_y$ such that $y \in f(A_y)$, by the intermediate value theorem there's a $c_y \in \text{Int}(A_y)$ such that $f(c_y) = y$.
