Let $f:M\to N$ be continuous and locally injective. If M is connected and exist a continuous function $g:N\to M$ such that $ fg= id_N$ then f is a homeomorphism from M to N.
First clearly f is surjective, since exist a right inverse. But I don't know how to proceed. I don't know how to prove the injectivity.
This problem it's from a book of metric spaces, maybe the hyphotesis also holds for general topological spaces, I'm not sure.