A locally injective but non globally injective function? A continuous function $f : U \subset \mathbb{R}^n \to \mathbb{R}^n$, is said to be locally injective at $x_0 \in U$ if exist a neighborhood $V \subset U$ of $x_0$ s.t. $f|_V$ is injective. $f$ is said to be locally injective on $U$ if is locally injective at all points of $U$.
If $n=1$, clearly $f$ is locally injective on $U$ iff it's injective on $U$. If $n >1$, this is false (at least is what I believe).
Does anybody know a counterexample i.e. a continuous function which is locally injective on an open $U$ set but it's not injective on $U$?
[observation] if $f$ is locally injective, by the invariance domain theorem is a local homeomorphism. if $f$ is also proper (i.e. the counter-image of a compact set is compact), then it's also a global homeomorphism (Caccioppoli theorem), and consequently injective. This means the counterexample cannot be a proper map.
[edit] I forgot to specify that I was interested in continuous functions.
 A: An easy way to find such an example is to take any non-constant holomorphic function $f:U \to \mathbb{C}$ and throw away the points where $f' = 0$. A holomorphic function is locally injective if $f'(z) \neq 0$, so we need only ensure that the function is not globally injective.
As I pointed out in a comment, we can take $U = \mathbb{C} \smallsetminus \{0\}$ and $f(z) = z^n$ for $n \geq 2$. Or, if you prefer, $f(z) = e^z$ on all of $\mathbb{C}$ for the most simple-minded examples.
These examples are easily extended to $\mathbb{R}^n$, $n \geq 2$, simply by writing $\mathbb{R}^n = \mathbb{C} \times \mathbb{R}^{n-2} \ni(z,v)$ and considering $g(z,v) = (f(z), v)$. I'll leave it to your creativity to build many more and more interesting examples.
A: Let's consider the continously differentiable function $f:\mathbb{R}^2\to\mathbb{R}^2$ with
\begin{align*}
f(x,y):=\begin{pmatrix}e^x\cos(y)\\e^x\sin(y)\end{pmatrix}\text{ and } Df(x,y)=\begin{pmatrix}e^x\cos(y)&-e^x\sin(y)\\e^x\sin(y)&e^x\cos(y)\end{pmatrix}.
\end{align*}
We see that $\det(Df(x,y))\neq0$ for all $(x,y)\in\mathbb{R}^2$, so we can apply the inverse function theorem to all points $(x,y)\in\mathbb{R}^2$. Hence, $f$ is locally injective everywhere. As $f(0,\pi)=f(0,3\pi)$ it's clear that $f$ can't be (globally) injective.
A: Let $U\subset\mathbb{R}^2$ be the set $\{(x,y)|1\lt x\lt2 \& 0\lt y\lt7\}$ and $f$ be $(x,y) \mapsto (x\times\sin(y), x\times\cos(y))$ . $f$ is locally injective on $U$ but $f(1,0)=f(1,2\pi)$.
A: Let U ⊂ R, and let  f: U ⊂ R $\to R^2$  be  t $\to$ ($t^2$ - 1 , t($t^2$ - 1)). It is locally injective at all points of R, but not injective in any interval (-a,a) with $a\gt 1$, because f(-1)=f(1)=(0,0)
