# How can I show that irreducibility for this set?

$k$ is an algebraically closed field. $X$ $\subseteq$ $A^n$ is an affine irreducible variety and $f \in k[x_1,...,x_n]$

$X_f = \{ (x_1,...,x_n) \in X \mid f(x_1,...,x_n) \neq 0\}$

$Y:=\{(x_1,...,x_n,1/f(x_1,...,x_n)) \mid (x_1,...,x_n) \in X_f \}$

I know this set $Y$ is an affine variety. Because we can write that

$Y$= $Z(I(X), 1-x_{n+1}f)$

But

1) How can we show that $Y$ is an irreducible variety?

2) How can we show that $Y$'s coordinate ring isomorphic to

$k[x]_f = \{ g/f^n \mid n \in \mathbb{N} , g \in k[x]\}$

I need some hint. I don't know how can I start for them.

You are not correct to say that $Y = Z(I(X), 1-x_{n+1}f)$. Note that $I(X)$ is the ideal of functions vanishing on $X$, which is a principal ideal generated by $f$. If $f$ and $1-x_{n+1}f$ vanish on $Y$, then $1$ also vanishes on $Y$, which is impossible. Actually, we have that $Y = Z(1-x_{n+1}f)$.
Now $Y$ is a subvariety of $\mathbb{A}^{n+1}$, and its coordinate ring is obtained by taking the quotient of the coordinate ring of $\mathbb{A}^{n+1}$ by the ideal that cuts $Y$ out, namely the principal ideal generated by $1-x_{n+1}f$. Thus, we have that $$\text{coord. ring of }Y = k[x_1, \dots, x_{n+1}]/(1-x_{n+1}f).$$ It is easy enough to see that the above ring is isomorphic to the localization of $k[x_1, \dots, x_n]$ at the multiplicative set generated by $f$ via the isomorphism $x_{n+1} \leftrightarrow 1/f$.
As for irreducibility, try to prove this topological fact: any open subset of an irreducible set is irreducible. Then notice that $Y$ is irreducible when viewed as an open subset of $\mathbb{A}^n$ (indeed, note that $Y$ is equal as a set to $X_f$, which is the complement of a closed subset of $\mathbb{A}^n$).