# Minimum conditions for $f(x_n) \to f(x)$ to imply $x_n \to x$?

In general, even if $f$ is continuous, $f(x_n) \to f(x)$ does not imply $x_n \to x$. But suppose that $f^{-1}(f(x))$ is a singleton, and that $f$ is uniformly continuous or that it is continuous and its domain is compact. Then is it true that $x_n \to x$? What are some of the weakest conditions for the implication to hold?

I think you will need $f$ to be one-to-one (invertible), as otherwise even for very nice functions the claim might fail. For instance, take $f(x) = x^2$ on $[-1,1]$ and then let $x_n \to -1$ and set $x = 1$. Then we have $f(x_n) \to f(x)$ but not $x_n \to x$.
Now, if $f$ is invertible, then we have $y_n := f(x_n) \to f(x) :=y$ and ask for $x_n \to x$ which is $f^{-1}(y_n) \to f^{-1}(y)$, which boils down to continuity of the inverse.
So, it seems $f$ invertible with continuous inverse is what you ask for.
Suppose $f: K \to \mathbf{R}$, where $K$ is a compact subset of $\mathbf{R}^n$, and $f^{-1}(f(x))$ is a singleton. Since $(x_k) \subset K$, it has a convergent subsequence $x_{k_i} \to z$. If $z \neq y$, then $f(x_{k_i}) \to f(z) \neq f(y)$, a contradiction. This applies to any such sub-sequential limit of $x_k$, and thus $x_k \to y$.