From Rotman's Algebraic Topology:
Prove: If $K$ and $L$ are simplicial complexes and if there exists a homeomorphism $f: |K| \rightarrow |L|$, then $\text{dim }K = \text{dim } L$.
Partial proof:
Suppose $m = \text{dim } K \gt \text{dim } L =n$. Take an $m$-simplex $\sigma$ in $K$ and let $\sigma^{\circ} = \sigma - \dot \sigma$ be its interior. Now $\sigma ^{\circ}$ is an open set in $|K|$. Since $f$ is a homeomorphism , $f(\sigma^{\circ})$ is open in $|L|$. There thus exists some $p$-simplex $\tau$ in $L$ with $f(\sigma^{\circ}) \cap \tau ^{\circ} = W$, a nonempty open set in $|L|$. Choose a homeomorphism $\phi : \Delta^m \rightarrow \sigma$ with $\phi(\dot \Delta^m) = \dot \sigma$; then $U$, defined by $U = \phi^{-1} f^{-1}(W)$, is an open subset of $(\Delta^m)^{\circ}.$ Since $p \lt m$, there exists an imbedding $g : \Delta ^p \rightarrow (\Delta^m)^{\circ}$ such that $\text{im } g$ contains no nonempty open subsets of $(\Delta ^ m) ^{\circ}$. Both $U$ and $g(W)$ are homeomorphic subset of $(\Delta^m)^{\circ}...$
Why are both $U$ and $g(W)$ homeomorphic subsets of $(\Delta^m)^{\circ}$?
And how can $g(W)$ be defined? $g : \Delta^p \rightarrow (\Delta^m)^{\circ}$ and $W$ is just an open set in $|L|$ so $W$ is not in the domain of $\Delta^p$.
I think the confusion is caused by the fact that the authors identify $\tau$ with $\Delta^p$ without mentioning the homeomorphism. Let's make that more explicit. As $\tau$ is a $p$-simplex, we have a homeomorphism
$$\varphi: \Delta^p \to \tau$$
Now we can not immediately apply $g$ to the subset $W$ of $\tau$. We first need to go through the homeomorphism $\varphi$. So we work with $g(\varphi^{-1}(W))$. If we would have identified $\Delta^p \cong \tau$ then we would write $g(W)$.
Now using this more clear notation it should be easy to verify:
$$g(\varphi^{-1}(W)) \cong \varphi^{-1}(W) \cong W \cong f^{-1}(W) \cong \phi^{-1}(f^{-1}(W)) = U$$
Perhaps it is more clear in a diagram:
$$ \begin{array}{ccc} \Delta^m & \xrightarrow{\phi} & \sigma\\ \cup & & \cup\\ g(\varphi^{-1}(W)) & \stackrel{*}\cong & f^{-1}(W)\\ \small{g|_{\varphi^{-1}(W)}}\Bigg\uparrow\quad\quad\quad & & \quad\quad\Bigg\uparrow \small{f^{-1}|_{W}}\\ \varphi^{-1}(W) & \xrightarrow{\varphi|_{\varphi^{-1}(W)}} & W\\ \cap & & \cap\\ \Delta^p & \xrightarrow{\varphi} & \tau\\ \end{array} $$
All arrows in this diagram are homeomorphisms. You can check the homeomorphism $\stackrel{*}\cong$ by going through the bottom of the diagram. After applying $\phi^{-1}$ to $f^{-1}(W)$ we end up with homeomorphic subsets of $(\Delta^m)^\circ.$