Sequential criterion of continuity We know for a continuous function $f: \mathbb{R}^n \to \mathbb{R}$, $\lim_{k \to \infty} f(x_k) = f(\bar x)$ may not imply $\lim_{k \to \infty} x_k = \bar x$. I was wondering a generalized condition on $f$ so that $x_k \to \bar x$ is equivalent to $f(x_k) \to f(\bar x)$. I sense that if $f$ is injective on $\mathbb{R}^n$ then this equivalence can be followed, but how to prove this? Does there exist any other generalized condition than injectivity for which the above equivalence hold?
 A: In the case where $f$ is a continuous function from $\mathbb{R}$ to $\mathbb{R}$ (i.e. $n = 1$), the injectivity of $f$ does indeed mean that if $f(x_k) \to f(\bar{x})$, then $x_k \to \bar{x}$. Here's a proof.
Let $\varepsilon > 0$. Then, consider $f(\bar{x} + \varepsilon)$ and $f(\bar{x} - \varepsilon)$. By injectivity of $f$, we have
\begin{align*}
\delta = \min\left(|f(\bar{x}) - f(\bar{x} - \varepsilon)|, \ |f(\bar{x}) - f(\bar{x} + \varepsilon)|\right) > 0.
\end{align*}
Since $f(x_k) \to f(\bar{x})$, this means that there is a $K \in \mathbb{N}$ such that
\begin{align*}
k \geq K \Rightarrow |f(x_k) - f(\bar{x})| < \delta.
\end{align*}
Furthermore, since $f$ is injective, $f$ is also strictly monotonic and thus, it follows that for any $x$ such that $|x - \bar{x}| \geq \varepsilon$, $|f(x) - f(\bar{x})| \geq \delta$. In other words, if $|f(x) - f(\bar{x})| < \delta$, then $|x - \bar{x}| < \varepsilon$.
Therefore, we obtain that
\begin{align*}
k \geq K \Rightarrow |x_k - \bar{x}| < \varepsilon
\end{align*}
and so, $x_k \to \bar{x}$.
