Purely inseparable dominant rational map of irreducible affine varieties induces homeomorphism of open-dense subsets. 
Let $f:X\dashrightarrow Y$ be a dominant rational map of irreducible affine
  varieties which induces a purely inseparable field extension $k(Y)\to k(X)$. Prove that there is an open-dense subset $V\subset Y$ such that $f$ defines a homeomorphism $f^{-1}V\to V$.

This is an exercise from an algebraic geometry course notes. There is a hint: show first that it suffices to treat the case when $k(X)$ is obtained from $k(Y)$ by adjoining the $p$th root of an element $g\in k(Y)$ (which I have checked). Then observe that if $g$ is regular on the affine open-dense $V\subset Y$, then $Y$ contains as an open dense subset an open sense subset of the locus of $(x,t)\in V\times \mathbb{A}^1$ satisfying $t^p=g$ (which I find confusing).
 A: We are reduced to the case $k(X) = k(Y)[X]/(X^p - g)$, where $g\in k(Y)$. Also we can assume that $f$ is surjective otherwise we can replace $Y$ by a suitable open dense subset.
Let $g$ be defined on some affine open dense subset say V of $Y$. Consider the subvariety of $V \times \mathbb{A}^1$ defined by the equations $g-t^p$, call it $W$. Note that since $g$ is defined on $f$, the $p-$th root of image of $g$ in $k(X)$ is defined over $f^{-1}(V)$.
Now, $k[W] = k[V][t]/(t^p - g)$, thus we see that the canonical inclusion $k[W] \hookrightarrow k[f^{-1}(V)]$ induces isomorphism on rational functions $k(W) \xrightarrow{\cong} k(X)$. Thus the induced map on varities $\tilde{f} : f^{-1}(V) \rightarrow W$ is a birational map. Hence there exists an open subset $W' \subset W$ such that $\tilde{f}|_{\tilde{f}^{-1}(W')} : \tilde{f}^{-1}(W') \rightarrow W'$ is an isomorphism. Note that here we can take the open set $\tilde{f}^{-1}(W')$in $X$ since $\tilde{f}$ is defined on all of $f^{-1}(V)$. Hence this is a homeomorphism.
Consider the first projection $pr_1 : V \times \mathbb{A}^1 \rightarrow V$. Note that $pr_1 \circ \tilde{f} = f|_{f^{-1}(V)}$. Hence our main task is now to prove $pr_1|_W$ is a homeomorphism.
Claim : The map $pr_1|_W$ is a homeomorphism onto $V$.
Assuming the claim we first prove the required statement. Let $V'$ be an open affine subset of $pr_1(W')$, we can do this since $pr_1$ is an open map and $W'$ is open in $V \times \mathbb{A}^1$. Then we replace $W'$ by $pr_1^{-1}(V')$. Now it is clear that $f|_{f^{-1}(V')} : f^{-1}(V') \rightarrow V'$ is a homeomorphism.
Proof of claim : Note that $k[V] \hookrightarrow k[V][t]/(t^p - g)$ is an integral extension and hence it satisfies going up property and thus induces a closed map on spectra that is $pr_1$ is a closed mapping. Also since the extension is purely inseparable the map on spec is bijective. This is an exercise from Atiyah's Commutative Algebra chapter 5, Exercise 15. A bijective closed map is a homeomorphism. Hence the proof of the claim.
