If $f$ is locally injective, then for each $y \in \mathbb{R^m}$, the pre-image $f^{-1}(y)$ is a discrete set. 

Let $E \subseteq \mathbb{R^n}$. We say that $f:E \to \mathbb{R^m}$ is a locally injective function if, and only if, for each $x \in E$,
    there exists a $r>0$ such that $f$ is injective in $B_r(x)\cap E$. And
    $A \subseteq \mathbb{R^n}$ is a discrete set if each point in A is an
    isolated point. Prove that:

  
  
*
  
*If $f$ is locally injective, then for each $y \in \mathbb{R^m}$, the pre-image $f^{-1}(y)$ is a discrete set.
  
*If $f$ is locally injective, continuous, and $E$ is compact, so for each each $y \in \mathbb{R^m}$, the pre-image $f^{-1}(y)$ is a
  finite set.
  

My attempt: 


*

*For this one I've tried a proof by contradiction. Suppose that $\exists y \in \mathbb{R^m}$ such that $f^{-1}(y)$ is not a discrete set, i.e., $\exists x \in (f^{-1}(y))'$ such that $B_r^*(x)\cap (f^{-1}(y)) \ne \emptyset$, $\forall r>0$. From this, I don't know how to get the contradiction (maybe a proof by contradiction is not the best way).

*I don't even know how to start this one. 


Any hints would be appreciated! Thank you.
 A: I'll say a few words about $(2)$ since it follows easily from $(1)$ with the right philosophy. Basically, you should see the word 'compactness' and immediately think 'finite.' The way this works is that one definition of compactness, perhaps not the one you've seen, is that a set $E$ is compact if every cover of $E$ by open sets has a finite subcover. 
So since your function $f$ is assumed to be locally injective, this means that around every point, there is a neighborhood on which $f$ is injective. This gives a cover of $E$ by such neighborhoods, and by compactness, finitely many such sets suffice. Now you know from the first part that the pre-image is discrete. We need to turn this into finite (because of course there are infinite discrete sets).
But the upshot is that in $\mathbb{R}^n$ and subsets thereof, the inverse image of a compact set, such as a singleton, is also a compact set. In fact, this happens for maps between any two Hausdorff topological spaces. Compact discrete sets must be finite (as their discreteness means that each one regarded as a singleton set would be open, and in order to have a finite sub-cover of this cover by singletons, there must have been only finitely many in the first place).
A: For $(i)$ choose $y\in \Bbb R^m$ and let $x\in f^{-1}(y)$. Therefore, $f$ is injective on $B_r(x)\cap E$ for some $r>0$. Now, if there is a point $x'\in f^{-1}(y)\cap B_r(x)$ with $x\not=x'$ then, $f(x)=f(x')$, contradicting the injective property of $f$ on $B_r(x)$. Hence, $f^{-1}(y)\cap B_r(x)$ is singleton. So each point of $f^{-1}(y)$ is isolated.
For $(ii)$ note that, $f$ is continouos implies $f^{-1}(y)$ is a closed subset in $E$, as $\{y\}$ is closed in $\Bbb R^m$. But $E$ is compact, so $f^{-1}(y)$ is also compact. Also local injectivity of $f$ gives $f^{-1}(y)$ is discrete set. But, discrete compact sets are finite. So we are done.
