Surjective maps of affine spaces are closed Let $f: \mathbb{A}^n \to \mathbb{A}^n$ be a quasi-finite surjective morphism.
Question: Is $f$ closed ?
 A: Here is a counterexample, inspired by this post:
Example. Let $f \colon \mathbf A^2 \to \mathbf A^2$ be given by
$$(x,y) \mapsto \big(x^2y^2,y(xy-1)+x\big).$$
Then $f$ is the composition of the maps
$$\begin{array}{ccccc}\mathbf A^2 & \stackrel g\longrightarrow & \mathbf A^2 & \stackrel h\longrightarrow & \mathbf A^2 \\ (x,y) & \longmapsto & (xy,y(xy-1)+x),\! & & \\ & & (x,y) & \longmapsto & (x^2,y),\! \end{array}$$
where $h$ is finite surjective and $g$ is quasi-finite missing only $(1,0)$:

*

*If $(a,b) \in \mathbf A^2(k)$ has $a = 1$, then the preimage consists of those $(x,y) \in \mathbf A^2(k)$ with $xy=1$ and $x=b$. This is only $(b,b^{-1})$ for $b \neq 0$, and there is no solution if $b = 0$.

*If $(a,b) \in \mathbf A^2(k)$ has $a \neq 1$, then the preimage consists of those $(x,y) \in \mathbf A^2(k)$ with $xy=a$ and $(a-1)y+x=b$. Substituting $y=(b-x)/(a-1)$ in $xy=a$ and multiplying by $(a-1)$ gives the quadratic equation $x^2-bx+a^2-a=0$, which has one or two solutions.

Since $g$ and $h$ are quasi-finite, so is $f$, and since $h(1,0) = h(-1,0)$ we see that $f$ is surjective. But $f$ is not closed: the restriction to the hyperbola $xy=1$ is given by $(x,y) \mapsto (1,x)$, which misses the point $(1,1)$.
