Let $X,Y$ be varieties and suppose we have points $P \in X, Q \in Y$ such that the corresponding local rings are isomorphic, i.e. $\mathcal{O}_{Q,Y} \cong \mathcal{O}_{P,X}$. Then the problem is to show that there exist open sets $P \in U \subset X, Q \in V \subset Y$ and an isomorphism $U \cong V$ that takes $P$ to $Q$.
The solution given in http://math.berkeley.edu/~reb/courses/256A/1.4.pdf proceeds as follows: Let $f:\mathcal{O}_{Q,Y} \rightarrow \mathcal{O}_{P,X}$ be the isomorphism of local rings. We can consider $X,Y$ to be affine varieties of the same affine space $\mathbb{A}^n$. Moreover, we can take $P=Q=0$. Let $y_1,\dots,y_n$ be the coordinate functions on $\mathbb{A}^n$. Since $y_i$ is a regular function on $Y$, then it can be viewed as an element of the local ring $\mathcal{O}_{Q,Y}$, say $\langle V_i, y_i \rangle$. Under $f$ it is taken to a germ $\langle U_i, f(y_i) \rangle$. Define the open set $U$ of $X$ by $U = \cap_i U_i$. Then we can define a morphism $f^*: U \rightarrow Y$ by sending $(a_1,\dots,a_n) \in X$ to $(f(y_1)(a_1,\dots,a_n),\dots,f(y_n)(a_1,\dots,a_n))$. The solution then says that likewise we can define a morphism $g^*:V \rightarrow X$ on an open set $V$ of $Y$ and the composition of the two morphisms is the identity wherever it is defined.
Question 1: How exactly is $g^*$ defined? If i define it in the same manner as $f^*$ then i don't see why i get the identity.
Question 2: Why can we even compose $g^*$ and $f^*$? It seems that we have no guarantee that these morphisms are dominant.
Edit Any alternative solution to this problem will be accepted as answer as well. Edit