Suppose $A$ is an integrally closed domain and that $f\in A$ has no repeated prime factors. Then $z^2-f$ is irreducible and $B:=A[z]/(z^2-f)$ is an integral domain. I am trying to see why $K(B)$, the fraction field of $B$, is $K(A)[z]/(z^2-f)$.
In $K(B)$, we are inverting all elements of $B$ that are not contained in the ideal $(z^2-f)$. So then I think this should give us $K(B)=(A[z]-(z^2-f))^{-1}B$.
Is this correct? And if so, why are the two forms of $K(B)$ equal?