A question about a continuous function that satisfies the property $\forall x\in\mathbb{R},\exists xI got this question:
Let $f:\mathbb{R}\to\mathbb{R}$ be a continuous function that satisfies the property: forall $x\in\mathbb{R}$ there exists $y \in\mathbb{R}$ such that $x < y$ and $f(x)<f(y)$
I was able to prove (hard proof though) that if $a\in\mathbb{R}$ then forall $0<M$ there exists $M<y$ such that $f(a)<f(y)$ and take this for granted.
Prove that if $lim_{x\to\infty}f(x)=5$ then $\forall x\in\mathbb{R}, f(x)<5$
But I got stuck. Thanks.

Assume that there is an $a$ such that $f(a) > 5$. Let $\epsilon = f(a) - 5 > 0$. If 
$$
\lim_{x\to \infty} f(x) = 5
$$
then you would have an $N$ such that if $x  \geq N$ then $\lvert f(x) - 5 \rvert < \epsilon / 2$.
Now $f$ being continuous on $[a, N]$ where $f(a) > f(N)$, $f$ attains a maximum at $x_0$ on $[a, N]$. This is also the maximum on $[a, \infty)$. But this contradicts the existence of a $y > x_0$ such that $f(x_0) < f(y)$.
