# Sequence that converges to 0 but its function diverges

Let f(x)=-2x+1 if x<0 and f(x)=$x^2$+x if x>0. Give a sequence {$x_n$} in $\mathbb R$\ {0} such that {$x_n$} converges to zero but {f($x_n$)} diverges.

I've tried with the sequence {1/n} but it does not seem to work. I can't think of another sequence that would converge to zero. Can anyone help me out please?

Thanks.

• I am a little confused by what the question means by the function at x<0 and x>0. So the function of the sequence must diverge while the sequence converges. Nov 17, 2014 at 0:36
• If x is negative than the function value is computed by the first expression while if x is positive then the function value is computed by the second expression. For example, f(-1)=3 while f(1)=2 Nov 17, 2014 at 0:42
• But x is a term of the sequence {$x_n$} right? Nov 17, 2014 at 0:53
• $x$ is just a variable while $x_n$ would be a subscripted variable. Nov 17, 2014 at 0:59

How about $x_n=\frac{(-1)^n}{n}$ for a sequence that converges to zero but alternates in sign which would make the function values be different. Thus, the sequence here is: $-1,\frac{1}{2},-\frac{1}{3},\frac{1}{4},-\frac{1}{5},\cdots$

For odd $n$, the function values will converge to 1. The first few function values here would be $3,\frac{5}{3},\frac{7}{5}$ as the general term will be $\frac{n+2}{n}$ which could also be seen as $1+\frac{2}{n}$

For even $n$, the function values would be $\frac{1}{n^2}+\frac{1}{n}=\frac{n+1}{n^2}$ which would have function values of $\frac{3}{4},\frac{5}{16},\frac{7}{36},...\frac{11}{100}, .... \frac{101}{10,000},...\frac{1001}{1,000,000}$ which will likely converge to 0 from this side as the denominator is growing much faster than the numerator.

Putting these together, the function value sequence would look like this: $3,\frac{3}{4},\frac{5}{3},\frac{5}{16},\frac{7}{5},\frac{7}{36},\frac{9}{7},\frac{9}{64}..., \frac{2k+1}{2k-1},\frac{2k+1}{(2k)^2},\frac{2k+3}{2k+1},\frac{2k+3}{(2k+2)^2}...$ which doesn't converge since there are sub-sequences which converge to different values.

If you want, consider $\varepsilon=\frac{1}{10}$ and try to prove the function value sequence converge,i.e. there exists $L,N$ such that for all $n>N\implies|f(n)-L|<\varepsilon$.

If you believe they converge to 0, consider some big odd $n>N$ where the function value will be greater than 1 which doesn't work.

If you believe they converge to 1, consider some big even $n$ where the function value will be close to zero and more than .1 away from 1 as for $n=1000$ then the function value is $\frac{1001}{1,000,000}=.001001$. Any bigger even $n$ will have even smaller values to consider.

If you have an alternative proof of what is wrong with my above answers, show me the error.

• Does {f($x_n$)} diverge in this case? I tried it but it looks like it converges to 1. Nov 17, 2014 at 0:31
• @Su003, even terms will converge to $0$, odd terms to $1$.
– lhf
Nov 17, 2014 at 0:33
• I understand this. But what is confusing me is that the question says that {f($x_n$)} must diverge. Does such an {$x_n$} work in this case? Nov 17, 2014 at 1:37

The main point here is that $f$ is not continuous at $x=0$. It does have one-sided limits at $x=0$, but they are different. So, you need to find a sequence that converges to $0$ but visits both sides infinitely often. The answer by JB King uses the simplest possible such sequence.