Let $X$ be an affine quasi-projective variety and $f\in k[X]$, the coordinate ring of $X$. Show $X\backslash V(f)$ is also affine. We say quasi-projective varieties are affine if they are isomorphic (we define morphisms between quasi-projective varieties to be maps that are locally polynomial, i.e. for quasi-projective varieties $X$ and $Y$, $F:X\to Y$ is morphism if for all $p\in X$ there exists open nbhd 
$U$ of $p$ so that $F$ restrict to $U$ is a polynomial map) to some $V(I)$ where $I\leq k[x_1,...,x_n]$.
We remark that bijective morphism is not necessarily isomorphism.
When $X$ is affine (quasi-projective), we define the coordinate ring of $X$, $k[X]$, to be the coordinate ring of $V(I)$ where $X\cong V(I)$.
I'm trying to show $X$ is affine imply $X\backslash V(f)$ is also affine for $f\in k[X]$.
In particular, we have $X\backslash V(f)\cong V(J)\subseteq \mathbb A^{n+1}$ where $J=I+\langle x_{n+1}f-1\rangle$ if $X\cong V(I)\subseteq \mathbb A^n$.
I can show that the projection mapping $\pi:V(J)\to X\backslash V(f)$ is a morphism and it is bijective, however, I'm not sure how to proceed to show there exists an inverse morphism of $\pi$. I know the inverse should be $\pi^{-1}(x_1,...,x_n)=(x_1,...,x_n,\frac{1}{f(x_1,...,x_n)})$, however, I failed to find a open nbhd around $(x_1,...,x_n)$ so that taking inverse is an polynomial map.
 A: Your definition of a morphism is wrong: you want a map to be given locally by quotients of polynomials such that the denominator doesn't vanish. Once you make this change everything will work out.
A: You're confused because you're trying to apply one definition of a regular function in a situation where a more general definition is required.

If $X$ is a closed affine variety, then a regular function on $X$ is a function that is given by polynomials.

But regular functions need not be polynomials.

If $X$ is quasi-affine (open subset of a closed affine variety) then a regular function on $X$ is a rational function $f/g$ such that $g$ vanishes nowhere on $X$.

Even more generally, you want to check regularity on affine covers.

If $X, Y$ are quasi-projective then $f : X \to Y$ is regular if it is regular when looking at affine charts.

So now maybe you want to check that if $X = V(f_1,\dots,f_n)$ is a closed affine variety then every regular function $f/g$ on $X$ is a polynomial. We apply the Nullstellensatz; since $f_1, \dots, f_n, g$ do not have a common $0$ (by assumption $f_1 = \dots = f_n = 0$ implies $g \ne 0$) it must be that $(f_1,\dots,f_n,g) = (1)$ and that will give you a polynomial inverse of $g$ mod $(f_1,\dots,f_n)$.
