Let $j:\mathbb{A}^{n}\rightarrow\mathbb{A}^{n}$ an open immersion over a field $k$. Is it an isomorphism?

If $U \cong \mathbb A^n$ is the image of $j$, then the long exact sequence of a pair shows that $\mathbb A^n \setminus U$ has no cohomology in any degree, which is only possible if $U = \mathbb A^n$. More generally (using heavier machinery), no variety $X$ is isomorphic to a Zariski open subset $U \subsetneq X$. The same long exact sequence shows that the HodgeDeligne polynomial of $X \setminus U$ would need to vanish, which is only possible for $X \setminus U = \varnothing$. 


Let $U \cong \mathbb{A}^n$ be the image of $j$ and let $\Delta = \mathbb{A}^n \setminus U$. Since $U$ is affine, $\Delta$ is purely codimension $1$, so $\Delta$ is the zero locus of some $f \in k[x_1, \ldots, x_n]$. But then $f$ is a unit on $U$, contradicting that $U \cong \mathbb{A}^n$. 

