Viewing schemes as varieties So this question is motivated from example 6.5.2 in Hartshorne Chapter 2. There he looks at $X=$Spec$(A)$ where $A=k[x,y,z]/(xy-z^2)$ and he calls $X$ a cone in $k^3$ which to me is the variety of that polynomial as defined in Chapter 1.
From section 4 there is a correspondence between varieties and integral separated schemes over a field and since we're working with divisors all schemes we are dealing with have these properties (plus others), so I can sort of see the relationship he is using here. However to what extent can we treat $X$ as a variety (ie. $Z(xy-z^2)$)? As he goes through the example he uses other variety-esque constructions (eg. $Y=\{y=z=0\}$ he claims is a prime divisor of $X$- how can you show that $Y$ is a closed integral subscheme of codim 1?) so how is this all justified?
 A: Question: "However to what extent can we treat X as a variety (ie. Z(xy−z2))? As he goes through the example he uses other variety-esque constructions (eg. Y={y=z=0} he claims is a prime divisor of X- how can you show that Y is a closed integral subscheme of codim 1?) so how is this all justified?"
Answer 1. When Hartshorne writes $Y: y=z=0$ he means the closed subscheme defined by the ideal $I:=\{\overline{y},\overline{z}\}$ in $Spec(A)$ where $A:=k[x,y,z]/(xy-z^2)\cong k[\overline{x}, \overline{y}, \overline{z}]$. By definition this is the scheme $Spec(B)$ where $B:=A/I \cong k[x]$.
Answer 2: $dim(X)=2$ and $dim(Y)=1$ hence $codim(Y,X)=1$. Since $Y\cong Spec(k[x])$ it follows $Y$ is an integral scheme since the polynomial ring $k[x]$ is an integral domain.
Note that an affine scheme $X:=Spec(A)$ is an "integral scheme" iff the ring $A$ is an integral domain: If $X$ is an integral scheme it follows by definition that $A$ is an integral domain. Conversely if $A$ is an integral domain, we must prove that $\mathcal{O}_X(U)$ is an integral domain for all open  sets $U$. Since $\mathcal{O}_X(U) \subseteq K(A)$ where $K(A)$ is the quotient field of $A$, it follows $\mathcal{O}_X(U)$ is an integral domain.
