# Existence of a function with finite $\lim\limits_{n\to \infty} f(n)$

Does there exist a continuous and bounded on $\mathbb{R}$ function $f(x)$ such that $\lim\limits_{x\to +\infty} f(x)$ does not exist but there exists the limit of the sequence $\lim\limits_{n\to \infty} f(n)$ $\quad$ $(n\in \mathbb{N})$ ?

$\sin x$ does not work, but may be there is a similar function?

• $f(x)=\sin(\pi x)$. – Omran Kouba Nov 4 '15 at 18:41

## 2 Answers

Check $x \mapsto \sin(\pi x)$.

It's not continuous, but: $$f(x)=\begin{cases}1,&x\in\Bbb N\\0,&x,\notin\Bbb N\end{cases}$$ works.

For continuous examples, $\sin(\pi x)$ works. (Note that $\sin(\pi n)=0$ for $n\in\Bbb N$.)