# Difficult Countexample Construction

Suppose that $f$ is a nonnegative continuous function on $\mathbb{R}$. Suppose for every $\epsilon\in[0,1)$ that one had $\lim_{n\in\mathbb{N}; n\to \infty} f(\epsilon+n)=0$. Give an example of a function $f(x)$ such that $\lim_{x\to\infty} f(x)\neq 0$.

• I don't think this is true. If $\lim_{x \rightarrow \infty} f(x) = c$ with $c>0$. Then $f(\epsilon + n)>c/2>0$ for every $n\geq N$ – iamvegan Sep 17 '16 at 20:35
• I got that part. The question is whether the limit needs to exist. This appears here as Exercise 4. math.upenn.edu/~vedranso/Practice1.pdf – user369849 Sep 17 '16 at 20:41
• Oh I see. The wording is a little unclear. So the limit can not exist then. – iamvegan Sep 17 '16 at 20:43

Hint: Consider $f$ defined on $R$ such that the restriction of $f$ to $[0,1]$ is $0$, if $n>0$,the restriction of $f$ to $[n,n+1]$ is defined by
$f(x)=0$ if $x\in [n,n+{1\over{n+1}}], x\in [n+{1\over n}, n+1]$,
The restriction of $f$ to $[n+{1\over{n+1}},n+{1\over n}]$ is a cut off function $g$ such that: if $a_n=n+{1\over{n+1}}$ and $b_n=n+{1\over{n}}$ $g(a_n)=g(b_n)=0$ and $g({{a_n+b_n}\over 2})=1$.
Same spirit as Tsemo's answer: You may define for $x=n+t$, $n\in {\Bbb N}$ and $0\leq t<1$: $$f(n+t)=nt^n(1-t)$$ One has for any fixed $t$: $\lim_{n\rightarrow \infty} f(n+t)=0$ but $f(n/(n+1))=(n/(n+1))^{n+1}\rightarrow e^{-1}$.