If $f$ is uniformly continuous, and its domain $D$ is totally bounded, then $f$ must be a bounded function. So, to find the necessary counterexample, you need to be a little trickier...
Here is a counterexample:
Consider
$$
\begin{align}
f:(\mathbb R,d) &\to(\mathbb R,|\cdot|)\\
x &\mapsto x
\end{align}
$$
Where $d(\cdot,\cdot)$ is the metric defined by
$$
d(x,y)=
\begin{cases}
|x-y| & |x - y|<1\\
1 & |x-y|\geq 1
\end{cases}
$$
Then $f$ is uniformly continuous, its domain is bounded (but not totally bounded), and its image is unbounded.
Well, the intermediate value theorem says that any continuous $f:I \to \mathbb{R}$, where $I \subset \mathbb{R}$ is an interval (and we allow notations like $(-\infty,\infty)=\mathbb{R}$) has the intermediate value property. So in order to find a function which fails to have the intermediate value property, it had better either be
- discontinuous, or
- defined on a set which is not an interval in $\mathbb{R}$
It turns out you can get a counterexample with either strategy. The idea of the intermediate value property is that the function can't "jump" from one value to the next: it has to take every value in between.
In fact, we'll use essentially the same function for both properties. Consider the function $f: \mathbb{R} \to \mathbb{R}$ defined by
$$f(x)=\cases{0 \quad \text{ if }x<0\\1\quad \text{ if }x>0}$$
and $f(0)=0$. Then $f$ is continuous everywhere except $0$, but it does not have the intermediate value property: $f$ takes the value $0$ (at $-1$), and it takes the value $1$ (at $1$), but there is no point $x$ such that $-1<x< 1$ and $f(x)=\frac{1}{2}$, say.
If, instead of taking $f$ as a function $\mathbb{R} \to \mathbb{R}$, we choose to look at it as a function $\mathbb{R} \setminus \{0\} \to \mathbb{R}$ (and do not define it at $x=0$), then it is continuous at every point at which it is defined, but fails to have the intermediate value property for the same reason. So both hypotheses of the theorem are necessary!
EDIT: There may be a slight confusion over whether this function is monotone increasing - this function is (according to the definition I'm used to) increasing, but not strictly increasing. It is pretty straightforward to use it to generate an example of a strictly increasing function, though.
Best Answer
Suppose $f:\mathbb{R}\to\mathbb{R}$ is a continuous solution. Let us consider the sequence $f(n)$, $n\in\mathbb{Z}$. If we write $$f(n)=\frac{a_n}{a_{n+1}},\tag{*}$$ by the given recursion formula, we have $$ f(n+1) = \frac{a_{n+1}}{a_n+a_{n+1}}. $$ This implies the sequence $a_n$ is a Fibonacci sequence, i.e. $a_{n+2} = a_{n+1}+a_n$. It is well-known that the general solution of $a_n$ is given by $$ a_n = A\alpha^n + B\beta^n $$ for some $A,B\in\mathbb{R}$ where $\alpha = \frac{1+\sqrt{5}}{2}$ and $\beta=\frac{1-\sqrt{5}}{2}$. Plugging this into the expression in $(*)$, we get $$ f(n) = \frac{A\alpha^n + B\beta^n}{A\alpha^{n+1} + B\beta^{n+1}}. $$ Assume that $A=0$. Since not both $A,B$ are $0$, we have $f(n) = \beta^{-1}$. In the same way, $f(n)=\alpha^{-1}$ holds if $B=0$. Now, assume that $A$ and $B$ are not zero. By taking limit as $n\to\pm\infty$, we have $$ \lim_{n\to\infty}f(n) = \alpha^{-1} = -\beta>\frac{1}{2}, $$ and $$ \lim_{n\to-\infty}f(n) =\beta^{-1} = -\alpha<-\frac{3}{2}. $$ But this implies by IVP that there exists $c\in\mathbb{R}$ such that $f(c)=0$. Since this is impossible as $f(x)\ne 0$, there are only $2$ possibilities: Either $f(n) \equiv \alpha^{-1}$ or $f(n)\equiv \beta^{-1}$. Finally, notice that the above argument applies in the same way to $f(x+n)$ for arbitrary $x\in \mathbb{R}$. This implies $f(\mathbb{R})\subset \{\alpha^{-1}, \beta^{-1}\}$. By the continuity of $f$, this says that $f$ must be a constant function. Thus the only continuous solutions to the equation are $$ f(x) \equiv \alpha^{-1} = \frac{-1+\sqrt{5}}{2} $$ or $$ f(x) \equiv \beta^{-1} = \frac{-1-\sqrt{5}}{2}. $$
Note: Note that for all $n\in\mathbb{Z}$, $$f(n)=\frac{a_n}{a_{n+1}}\notin\mathbb{Q} \Leftrightarrow f(n+1)=\frac{a_{n+1}}{a_n+a_{n+1}}\notin\mathbb{Q}.$$ Suppose that $f(0)= \frac{a_0}{a_{1}}$ is given by an irrational number. If $a_{n+2}=0$ for some $n\ge 0$, then $f(n)=-1$ holds and this contradicts $f(0)$ is irrational. In the same way, if $a_n=0$ for some $n<0$, then $f(n)=0$ holds and this contradicts $f(0)$ is irrational. So, the irrational initial data $f(0)$ guarantees that $f(n)$ is well-defined for all $n\in\mathbb{Z}$.
Let $a_0 = 1$ and $a_1=\pi$. If we solve it for $A,B$, we get $$ A=\frac{\beta-\pi}{\beta-\alpha},\quad B=\frac{\pi-\alpha}{\beta-\alpha}. $$ If we let $f(x) = \frac{1}{\pi}$ for $x\in [0,1)$, this implies $$ f(x+n) = \frac{(\beta-\pi)\alpha^n + (\pi-\alpha)\beta^n}{(\beta-\pi)\alpha^{n+1} + (\pi-\alpha)\beta^{n+1}}. $$ is well-defined for $n\in\mathbb{Z}$ and satisfies the given functional equation. This shows that $$ f(x)=\frac{(\beta-\pi)\alpha^{\lfloor x\rfloor} + (\pi-\alpha)\beta^{\lfloor x\rfloor}}{(\beta-\pi)\alpha^{{\lfloor x\rfloor}+1} + (\pi-\alpha)\beta^{{\lfloor x\rfloor}+1}} $$ is an example of a discontinuous solution $f:\mathbb{R}\to\mathbb{R}$.