Relation between the function image and function divergence Let $D = \{x\in \mathbb{R}~|~x\geq 0\}$ and $f:D \rightarrow \mathbb{R}$ be a continuous function with $f[D] = D$ ($f[D]$ is the image of $D$ via $f$). Then, I am going to show that $f(x) \rightarrow \infty $ as $x \rightarrow \infty$.
Let us start by assuming $f(x)$ converges to $c \geq 0$.
$$
\forall \epsilon > 0 \ \exists a \in D : \forall x \in D: x > a \implies |f(x) - c | < \epsilon \implies f(x) \leq c + \epsilon
$$
Then, $a = a(\epsilon)$. Meanwhile, by the extreme value theorem,
$$
\forall a \in D \ \exists b \in D : \forall x \in [0,a] : f(x) \leq b
$$
Then, $b = b(a)$.
Therefore, we have
$$
\forall \epsilon > 0 \ \forall x \in D : f(x) \leq \max \{ c + \epsilon, b(a(\epsilon)) \} < \infty
$$
hence $f[D] \neq D$, which is a contradiction.
Is this correct?
 A: No, what you want to prove is false, if you do not assume also that $f$ is monotonic increasing. Indeed, there exists a (non-monotonic) continuous function $f \colon D \to \mathbb{R}$ such that $f[D] = D$ but $f(x) \not\to \infty$ as $x \to \infty$. For instance, consider
$$\tag{1} f(x) = e^x |\sin(x)|$$
The $\sin(x)$ component gives an oscillating behavior to $f$, and the amplitude of these oscillations grows as $x \to \infty$ because of the $e^x$ component. Since $|\sin(x)| \geq 0$ for every $x \in \mathbb{R}$ and in particular for every $x \in D$, we have that $f[D] = D$.
What is wrong in your proof is the first step. You want to prove, by contradiction, that for every continuous function $f \colon D \to \mathbb{R}$, if $f[D] = D$ then $f(x) \to \infty$ as $x \to \infty$. So, you assume that there exists a continuous function $f \colon D \to \mathbb{R}$ such that $f[D] = D$ but $f(x) \not\to \infty$ as $x \to \infty$ and you want to show that this leads to a contradicton. But (and this is your error) the fact that $f(x) \not\to \infty$ as $x \to \infty$ does not imply that $f(x)$ converges to some $c$ in $f[D]$. Indeed, there is the possibility that $f(x) \not\to \infty$ as $x \to \infty$  because the limit of $f(x)$ as $x \to \infty$ does not exist! And this is what happens in the function $(1)$.
Actually, your proof is correct but for another statement: for every continuous function $f \colon D \to \mathbb{R}$, if $f[D] = D$ then it is impossible that $f(x)$ converges to $c$ (for any $c \geq 0$) as $x \to \infty$.
