Let $f: X\rightarrow Y$ be a continuous map of Hausdorff space and $K\subseteq X$ be a compact subset. Suppose that
$(a)$ $f|_K: K\rightarrow f(K)$ be a homeomorphism, and
$(b)$ for every $x\in K$ there exists open neighborhood $U_x$ of $x$ and $V_x$ of $f(x)$ such that $f$ stricts to a homeomorphism $U_x\rightarrow V_x$ given by $x\mapsto f(x)$ i.e. $V_x=f(U_x)$.
Then I want to prove that there exists an open subset $U\subseteq X$ containing $K$ and an open subset $V\subseteq Y$, such that $f$ restricts to a homeomorphism $U\rightarrow V$ given by $x\mapsto f(x)$.
I have no idea how to construct this open set, maybe it should be the intersection of the open neighborhood of $x\in K$? But I think it is not necessary to keep it open. Can someone help me?
Then I tried like below: Since $\{U_x|x\in K\}$ is an open cover of $K$, then by compactness of $K$, it should have a finite subcover say $\{U_{x_i}|i=1,...,n\}$
Then define $U=\bigcup_{i=1}^n U_{x_i}$.
I can see that the restriction is continuous and surjective, but I can not show that it is also injective, and therefore the continuity of its inverse map.