The key theorem for this exercise in the context of Hartshorne chapter I is theorem I.5.7A:
Theorem (Elimination Theory). Let $f_1,\cdots,f_r$ be homogeneous polynomials in $x_0,\cdots,x_n$, having indeterminate coefficients $a_{ij}$. Then there is a set $g_1,\cdots,g_t$ of polynomials in the $a_{ij}$, with integer coefficients, which are homogeneous in the coefficients of each $f_i$ separately, with the following property: for any field $k$, and for any set of special values of the $a_{ij}\in k$, a necessary and sufficient condition for the $f_i$ to have a common zero different from $(0,0,\cdots,0)$ is that the $a_{ij}$ are a common zero of the polynomials $g_j$.
This lets us prove that any map out of a projective variety is closed. $\renewcommand{\PP}{\mathbb{P}}$
To do this, we need to show that $\PP^n\times Y\to Y$ is a closed map for any variety $Y$.
By covering $Y$ with affines, we may reduce to the case that $Y$ is affine.
Now suppose $Z\subset \PP^n\times Y$ is closed: this means that it's cut out by a list of equations $f_1,\cdots,f_r$ which are homogeneous polynomials in the homogeneous coordinates on $\PP^n$ with coefficients taken from $A(Y)$.
By theorem I.5.7A, we may find polynomials $g_1,\cdots,g_s$ in the coefficients of these $f_i$ which vanish iff all the $f_i$ simultaneously vanish.
But this exactly means that the image of $Z\subset \PP^n\times Y$ under the projection $\PP^n\times Y\to Y$ is closed, or that the projection $\PP^n\times Y\to Y$ is closed.
Now consider a morphism $f:Z\to Y$ where $Z$ is projective and $i:Z\to \PP^n$ is the inclusion of $Z$ in to some projective space (guaranteed by the definition of projective).
We can factor $f$ as $Z\to \PP^n\times Y\to Y$ where the first map is $z\mapsto (i(z),f(z))$.
To show the image of this map is closed, cover $\PP^n\times Y$ by affine open subsets of the form $U_i\times Y$ for $U_i$ the standard affine opens.
Then on each of these opens, the set of points $(i(z),f(z))$ is closed because it's cut out by the equations for $Z\cap U_i$ and then also the equalities $y_i=f_i(z)$ where $y_i$ are the coordinate functions on $Y$ and $f_i$ are the components of the map $f$.
So the image of $Z$ in $\PP^n\times Y$ is closed and therefore the image of $Z$ in $Y$ is closed since the projection $\PP^n\times Y\to Y$ is closed.
To apply this to our problem, write $i:X\to Y$ for the inclusion.
Then by the above, $i(X)$ is closed in $Y$.