Problem in proving a statement regarding projective closure of an affine variety. In problem $2.9$ of Hartshorne section $1.2$, he defined projective closure of an affine variety. 
Let $Y\subset \mathbb A^n$ be an affine variety, let $\phi : U_0 \rightarrow \mathbb A^n$ be the homeomorphism sending $P=[a_0;..;a_n]\mapsto (a_1/a_0,...a_n/a_0)$ where $U_0= \mathbb P^n - Z(x_0)$. Then the projective closure of $Y$ in $\mathbb P^n$ is the closure of the image of $Y$ under the homeomorphism in $\mathbb P^n$. 
Let $\beta : k[y_1,...,y_n] \rightarrow k[x_0,..,x_n]$ be the map sending $g$ to $x_0^{deg \ g} g(x_1/x_0,..,x_n/x_0)$. Then $I(\overline Y)= ( \beta (I(Y)))$.
I could prove that $(\beta (I(Y)))\subset I(\overline Y)= I(\phi^{-1}(Y))$.
In the reverse direction I am stuck. In many online solutions I am seeing that they have used an argument like this: $f\in I(\overline Y) \Rightarrow f(P)=0 \forall P\in \phi^{-1} (Y) $ and It is assumed $f$ is homogeneous . Then $\beta(f(1,y_1,..,y_n)=f $ and $g= f(1,y_1,..,y_n) \in I(Y)$. 
But taking the example $xy^2+ xyz= f $ I am getting a contradiction at the step indicating $f$ is in the image of $\beta$. 
I was thinking to prove $\beta (I(Y))$ generates a prime ideal when $I(Y)$ is prime. But I couldn’t prove that.
Can anyone please help me out by suggesting any way to deal with this inclusion.
 A: Hint: we want to use a combination of $\alpha$ and $\beta$ (defined in the proof of proposition 2.2) to make this conclusion. Are there elements $f\in k[x_0,\cdots,x_n]$ so that $\beta(\alpha(f))=f$? Are there any of these elements in $I(\overline{Y})$? What can you say about these?
Full solution under the spoiler text.

 Assume $Y$ is nonempty. Then $\overline{Y}\subset\Bbb P^n$ is not contained in $V(x_0)$, so we can choose a generating set $\{f_1,\cdots,f_r\}$ for $I(\overline{Y})$ so that each $f_i$ is homogeneous and no $f_i$ is divisible by $x_0$. Now recall the operation $\alpha$ defined in the proof of proposition 2.2: $\alpha(f(x_0,\cdots,x_n))=f(1,y_1,\cdots,y_n)$, which lands in the coordinate algebra of $\Bbb A^n=U_0$, and if $f\in I(\overline{Y})$, then $\alpha(f)$ vanishes on $Y$ and so $\alpha(f)\in I(Y)$. On the other hand, $\beta(\alpha(f))=f$ for homogeneous $f\in k[x_0,\cdots,x_n]$ not divisible by $x_0$ - you can check this by straightforwards computation. So the elements $\alpha(f_i)$ are all in $I(Y)$ and $\beta$ of these elements generate $I(\overline{Y})$, so we have shown that $I(\overline{Y})$ is generated by $\beta(I(Y))$.

As for what's going on with your example of $xy^2+xyz$, the thing that's going wrong here is that taking $x$ to be $x_0$, we have that $\beta(\alpha(xy^2+xyz))=y^2+yz$. So $xy^2+xyz$ is in the ideal generated by $\beta(\alpha(xy^2+xyz))$, which is fine - if $xy^2+xyz$ is in the ideal of $\overline{Y}$ for some nonempty $Y\subset U_0$, then $y^2+yz$ must be also since $I(\overline{Y})$ is prime and does not contain $x$ because $\overline{Y}\not\subset V(x)$.
