# To show $f$ is continuous

Let $f:[0,1]\rightarrow \mathbb{R}$ is such that for every sequence $x_n\in [0,1]$, whenever both $x_n$ and $f(x_n)$ converges , we have $$\lim_{n\rightarrow\infty} f(x_n)=f(\lim_{n\rightarrow\infty}x_n),$$ we need to prove $f$ is continuous

well, I take $x_n$ and $y_n$ in $[0,1]$ such that $|(x_n-y_n)|\rightarrow 0$, and the given condition holds,Now enough to show $|f(x_n)-f(y_n)|\rightarrow 0$

I construct a new sequence $$z_1=x_1$$ $$z_2=y_1$$ $$\dots$$ $$z_{2n-1}=x_n$$ and $$z_{2n}=y_n$$

We see, that subsequence of $f(z_n)$ converges so it must be convergent to the same limit. Am I going in right path? please help.

-
Consider the function $f$ on $[0,1]$ defined by $f(0)=0$ and $f(x)=1/x$ for all $x \in (0,1]$. Then it satisfies the hypothesis but is not continuous on $[0,1]$. So the claim is false. The claim is false because the antecedent requires both $(x_n)$ and $(f(x_n))$ to be convergent. And for all $(x_n)$ that converges to $0, (f(x_n))$ is not convergent and hence the antecedent is false. Therefore the implication stands true, yet the function is not continuous on $[0,1]$! –  Kasun Fernando Jul 9 '12 at 14:07

I will prove a different claim because I have pointed out that what is mentioned here is wrong by a counter-example.

Let $f:[0,1]→\mathbb{R}$ is such that for every sequence $x_n∈[0,1]$ whenever $(x_n)$ converges , we have $\lim\limits_{n→∞}f(x_n)=f \left(\lim\limits_{n→∞}x_n \right)$ then $f$ is continous on $[0,1]$.

I think the best way is to use proof by contradiction. Assume $f$ is not continuous at $c \in [0,1]$ then there exist $\epsilon_{0} > 0$ such that for all $n \in \mathbb{N}$ there exist $x_{n} \in (c-1/n,c+1/n) \cap [0,1]$ such that $|f(x_n)-f(c)| \geq \epsilon_{0}>0$

Obviously $( x_n )$ converges to $c$ but $(f(x_n))$ does not converge to $f(c)$ ( Note that all the terms of $(f(x_n))$ are a positive distance away from $f(c)$ ) which is a contradiction with the given property of the function.

Since our choice of $c$ was arbitrary, we have that $f$ is continuous on $[0,1]$

-
are you assuming that $f(x_n)$ converges? why not $f(x_n)\rightarrow\infty$? –  La Belle Noiseuse Jul 9 '12 at 13:39
Who cares about $f(x_n)$, as long as it does not converge to $f(x)$? –  Siminore Jul 9 '12 at 13:41
I am wondering where he is using the fact given about $x_n$ and $f(x_n)$ converges together. –  La Belle Noiseuse Jul 9 '12 at 13:42
Consider the function $f$ on $[0,1]$ defined by $f(0)=0$ and $f(x)=1/x$ for all non-zero $x$. Then it satisfies the hypothesis but is not continuous on $[0,1]$. So the claim is false. What I have proven is the sequential criterion for continuity! –  Kasun Fernando Jul 9 '12 at 14:00