Let $(X,d)$ be a compact metric space and $f:X\to X$ a continuous map such that there exists $\delta$, so that $$f:B(x,\delta) \to f(B(x,\delta))$$ is a homeomorphism for any $x \in X$.
Show that there is a constant $0<\lambda<\delta$ such that for any $y\in X$ there are local inverses $g_1,\cdots, g_n$ of $f$ defined on $B(y,\lambda)$ satisfying $g_i(y)=x_i$ and $\{g_i(B(y,a))\}_{i=1}^n$ are pairwise disjoint.
First I showed that $f^{-1}(y)$ is finite, $f^{-1}(y)=\{x_1,\cdots,x_n\}$. Which is not difficult due to the compactness of $X$.
Now let $d(y):= \inf_{k\neq i} d(x_k,x_i)$ and take $0<r< \min\{\delta,d(y)/2\}$ so $f: B(x_j,r)\to f(B(x_j,r))$ is homeomorphic for each $1\le j \le n$.
Since $y$ is contained in the open set $\cap_{j=1}^{n} f(B(x_j,r))$ the exist $r_y$ such taht $B(y,r_y)$ is in the intersection. Now I construct the inverses
$$g_{y_i}: B(y,r_y) \to g_{y_j}(B(y,r_y))\subset B(x_i,r)$$
Thus $g_{y_i}(B(y,r_y))$ are disjoint, because $B(x_i,r)$ are disjoint.
The suggestion given to me would be to consider a cover of $X$ by balls of the form $\{B(y, r_{y}/2)\},y\in X$, so due to the compactness there is a finite coverage, $\{B(y_j, r_{y_j}/2)\}$.
The $\lambda$ that satisfies the exercise would be given by $\lambda=1/2\min{r_{y_j}}$.
But now, how would I construct the inverse $g's$? This part is confusing me.