A question about Integral Closures from Hartshorne Chapter 2 Exercise 6.4 The exercise that I'm having trouble with is the following. 
Hartshorne II.6.4: Let $k$ be a field of characteristic $\neq 2$. Let $f \in k[x_1, \dots x_n]$ be a square free nonconstant polynomial, i.e. in the unique factorization of $f$ into irreducible polynomials, there are no repeated factors. Let $A=k[x_1 \dots x_n,z]/(z^2-f)$. Show that $A$ is an integrally closed ring. [Hint: The quotient field $K$ of $A$ is just $k(x_1, \dots x_n)[z]/(z^2-f)$. It is a Galois extension of $k(x_1, \dots x_n)$ with Galois group $\mathbb{Z}/2\mathbb{Z}$ generated by $z \mapsto -z$. If $\alpha=g+hz \in K$, where $g,h \in k(x_1, \dots x_n)$, then the minimal polynomial of $\alpha$ is $X^2-2gX+(g^2-h^2f)$. Now show that $\alpha$ is integral over $k[x_1, \dots x_n]$ if and only if $g,h \in k[x_1, \dots x_n]$. Conclude that $A$ is the integral closure of $k[x_1, \dots x_n]$ in $K$.]
Even with the hint I have two questions.
1) Why do I require $f$ to be square-free? I know that I do not want $f$ to be a square, because then $(z^2-f)$ would not be a prime ideal in $k[x_1, \dots x_n,z]$. I cannot see where square-free is used though.
2) For $\alpha=g+hz$ with $g,h \in k(x_1, \dots x_n)$, the minimal polynomial over $k(x_1, \dots x_n)[z]$ is exactly the one given above. However, why couldn't there be some OTHER monic polynomial $s \in k[x_1, \dots x_n][z]$ such that $s(\alpha)=0$? I don't understand why $\alpha$ integral over $k[x_1, \dots x_n]$ forces $g,h \in k[x_1, \dots x_n]$. 
 A: Regarding your first question, @Mohan posted a counterexample in the comments: $R = k[x,y,z]/(z^2 - x^2y)$ has an integral element $\frac{z}{x}$, which is not contained in $R$:
$$\left(\frac{z}{x}\right)^2 = \frac{z^2}{x^2} = \frac{x^2y}{x^2} = y,$$
so an integral relation would be $t^2 - y$.
To see that square-free is sufficient, and to answer your second question we need a Theorem about how integral extensions of integral domains and algebraic extensions of their quotient fields relate. This can be found in Matsumura's Commutative ring theory, p.65:

Theorem 9.2. Let $A$ be an integrally closed domain, $K$ the field of fractions of $A$, and $L$ an algebraic extension of $K$. Then an element $\alpha \in L$ is integral over $A$ if and only if its minimal polynomial over $K$ has all its coefficients in $A$.

Here $A = k[x_1,\dots,x_n]$ which is a UDF, hence integrally closed in $K = k(x_1,\dots,x_n)$, and $L = k(x_1,\dots,x_n)[z]/(z^2 - f)$.
Now we can see the formal reason why $f$ has to be square-free: We have to show that if $\alpha = g + hz$ is integral, both $g$ and $h$ belong to $A = k[x_1,\dots,x_n]$. But the Theorem only tells aus that the coefficients of the minimal polynomial $m_\alpha = X^2 - 2gX + (g^2 - h^2f)$ belong to $A$: $g \in A$, because $2 \neq 0$ in $k$ (good) and $g^2 - h^2f \in A$, so at least $h^2 f \in A$. Now if $f$ is square-free, it cannot compensate any denominators in $h$, because those appear twice. Hence $h \in A$ follows.
