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.