I got stuck in the following exercise:
Let $p:\widetilde{X}\rightarrow X$ be a covering map with $\widetilde{X}$ connected and $p^{-1}(x)$ finite, for every $x\in X$.
Show that if there exists a continuous map $f:\widetilde{X}\rightarrow\mathbb{R}$, injective in each fibre $p^{-1}(x)$ (that is, if $p(x)=p(y)$ and $f(x)=f(y)$ then $x=y$), then $p$ is a homeomorphism.
Clearly, we need to prove only that $p$ is injective, since it is already surjective, continuous and open.