Is $A$ necessarily a compact set or a connected set? Let $f:\mathbb R\to \mathbb R$ be a continuous function and $A\subset \mathbb R$ is defined by :

$A=\{y\in \mathbb R:y=\lim f(x_n),$ for some sequence $x_n\to \infty\}$

Is $A$ necessarily  a compact set or a connected set?
My try:
Since $f$ is continuous and $x_n\to \infty$ so either $f(x_n)\to \infty $ or $f(x_n)\to -\infty$ .Hence $A$ is finite and compact but the answer is given to be connected. Where am I wrong?
 A: Adding to Alan's answer: to show that it is connected, prove that it is an interval.
Let $x,y \in A$ with $x \le y$, and let $z \in [x,y]$. Then, $\exists 0\le a \le 1$, such that $z = ax + (1-a)y$. Let $(x_n)$ be the one associated to $x$ and $(y_n)$ be that associated to $y$. 
Now put $u_n = af(x_n) +(1-a)f(y_n)$. Then, by IVT, for each $n \in \mathbb N$, $\exists z_n \in [x_n, y_n]$ or $[y_n, x_n]$ such that $u_n = f(z_n)$. 
Therefore, $z_n \to \infty$ and $f(z_n) \to z$, so $z \in A$.
A: To show that it is not compact,  consider a continuous function that is piecewise linear,  connecting (0,0), (1,1), (2,-1), (3,-2), (4,-2),  etc....so it is oscillating higher and higher over time.  (You can have the function be identically equal to 0 in the negatives).
Then your set $A$ will be all real numbers!   Because for any real number,  after you get past twice that number,  every interval of length 2 contains a point with that value, so you have a constant sequence of $x_n$ where the $y_n$ hits that y.
