To prove a real-valued function is (sequentially) continuous, is it enough to prove it for only monotone sequences? I have a function $f:\mathbb{R}\to \mathbb{R}$ and I wish to show that it is continuous using the sequential definition of continuity, i.e. that $f$ is continuous at $a$ if for any sequence $\{x_n\}\subset \mathbb{R}$ with $x_n \to a$, one has $f(x_n)\to f(a)$. Is it enough to show this for only monotone sequences $\{x_n\}$?
 A: THEOREM Suppose $f$ is a real function on $(a,b)$. Then
$$\tag{1}\lim_{x\rightarrow b-}f(x)=l$$
if and only if
$$\tag{2}\lim_{n\rightarrow\infty}f(x_n)=l$$
for every sequence $\{x_n\}$ in $(a,b)$ such that
$$x_n\rightarrow b,\quad\tag{3}x_n\leq x_{n+1},\quad x_n\not= b\mbox{.}$$
PROOF Suppose (1) holds. Let $\{x_n\}$ be a sequence satisfying (3). Given $\epsilon>0$, there exists $\delta>0$ such that
$$\lvert f(x)-l\rvert<\epsilon$$
if $\lvert x-b\rvert<\delta$, $x\in(a,b)$. Since $\{x_n\}$ converges to $b$,
$$\lvert x_n-b\rvert<\delta$$
for all $n$ from some definite index $N$ onward. It follows that $n\geq N$ implies
$$\lvert f(x_n)-l\rvert<\epsilon\mbox{,}$$
this means exactly (2).
Conversely, suppose (1) is false. Then there exists some positive $\epsilon$ such that for every $\delta>0$, there exists $x\in(a,b)$ such that $\lvert x-b\rvert<\delta$ but
$$\tag{4}\lvert f(x)-l\rvert\geq \epsilon\mbox{.}$$
Choose $x_1\in(a,b)$ so that (4) holds for $x=x_1$. Having chosen $x_1,...,x_k$ ($k\geq1$), choose $x_{k+1}\in(a,b)$ so that
$$x_{k+1}\geq x_k,\qquad\lvert x_{k+1}-b\rvert\leq\frac{1}{k+1}\mbox{,}$$
and (4) is valid for $x=x_{k+1}$.
Apparently, the sequence $\{x_n\}$ thus obtained satisfies (3) but contradicts (2). This completes the proof.
This theorem gives an affirmative answer to your question.

In fact, if we can show that, for every sequence $\{x_n\}$ in $(a,b)$ satisfying (3), $\{f(x_n)\}$ converges, then $\lim\limits_{x\rightarrow b-}f(x)$ exsits.
Let $\{x_n\}, \{y_n\}$ be sequences satisfying (3). We construct a sequence $\{z_n\}$ from $\{x_n\}$ and $\{y_n\}$ which satisfies (3).
Suppose, wihout loss of generality, $x_1\leq y_1$. Since $x_n\rightarrow b, y_1\not=b$, $x_{n_1}>y_1$ for some $n_1$. Let $n_1$ be the least possible choice. Define $z_j=x_j$ for $j=1,2,...,n_1-1$. Similarly, since $y_n\rightarrow b$, $x_{n_1}<b$, $y_{n_2}>x_{n_1}$ for some $n_2$. Again let $n_2$ be the least possible choice. Define $z_{n_1-1+j}=y_j$ for $j=1,2,...,n_2-1$. Continuing this process.
Since $\{f(x_n)\}, \{f(y_n)\}$ are subsequences of the convergent sequence $\{f(z_n)\}$, they converges to the same limit $l$. Hence (2) is valid for any sequences having the property (3), from which we conclude (1).
