TITLE: Example of a sequence $(a_{n})_{n\in \mathbb{N}}$ such that $\liminf_{n\rightarrow \infty}a_{n}=-1$ and $\limsup_{n\rightarrow \infty}a_{n}=1$
QUESTION [0 upvotes]: Construct an example of a sequence $(a_{n})_{n\in \mathbb{N}}$ such that $\liminf_{n\rightarrow \infty}a_{n}=-1$ and $\limsup_{n\rightarrow \infty}a_{n}=1$
Is it right if I say the answer is $f(n)=\frac{1}{n}$?

REPLY [0 votes]: No; for $f(n) = \frac{1}{n}$, we have $\lim_{n \to \infty} f(n) = 0$, so the lim sup and lim inf are all equal to zero. In general, the limit existing is equivalent to the lim inf and lim sup coinciding. So for the two to be different, the limit must not exist.
Take for instance $a_n := (-1)^n$. Then we get the sequence $(1,-1,1,-1,\cdots)$. Clearly there are infinitely many $a_n$ that are equal to $1$, and there is no larger number that the sequence can get close to, so $\limsup_{n \to \infty} a_n = 1$. Similarly $\liminf_{n \to \infty} a_n = -1$. Intuitively, the lim sup / lim inf is the largest (resp. smallest) number that infinitely many points in the sequence can get close to
{"set_name": "stack_exchange", "score": 0, "question_id": 2374580}