Question about solution in a book 
Find all the functions $f:\mathbb{R} \to \mathbb{R} $ which have the intermediate value property (IVP) and satisfy the relation $f(x+y) =f(x+f(y)) $, $\forall x, y \in \mathbb{R} $.

Since $f$ has IVP, we know that $f(\mathbb{R}) =I$, where $I$ is an interval. Taking $x=0$ in the initial relation we have $f(y) =f(f(y)) $, $\forall y \in \mathbb{R} $. Thus, $f(x) =x$, $\forall x\in I$.
Now here comes the part which I can't understand. The book goes on to prove that $I=\mathbb{R} $ by contradiction. They suppose that $I$ has an upper bound. Then $\exists a= \sup I$. Hence, $\exists x_n \to a$ so that $f(x_n) \to f(a) =a$.
Why does such a sequence exist? To me, it looks like they assumed that $f$ is continuous.       
 A: If you pick some $b_0 \in \mathbb{R} $ such that $b_0 \neq a$, then what you can do is by IVP find an element, say $b_1$ in $(b_0,a)$ such that $f(b_1)$ is arbitrarily close to $f(a)$, now you can also pick $b_0$ so that it is arbitrarily close to $a$, and so $b_1$ is arbitrarily close to $a$
Using this method you can see how you can find $(x_i)$ that satisfy the required properties.
The reason this isn't the same as continuous is because this doesn't necessarily hold for all sequences $(x_i)$, just that there exists some sequences for which this property holds.
A: I'm not entirely sure why they need the sequence, but it is not to hard to show that $f(a)=a$.
Let $a=\sup I=f(\mathbb{R})$. Now suppose that $f(a)\neq a$, then $f(a)<a$ as $f(a)\in I$. As $I$ is an interval we know that $b=\frac{1}{2}(f(a)+a)\in I$ and by the above we know that $f(b)=b$. By the IVP there exists a $c\in(b,a)\subset I$ such that $f(c)=\frac{1}{2}(f(a)+b)<b$, but also since $c\in I$ we $f(c)=c>b>f(c)$ which is a contradiction. Hence $f(a)=a$.
