Let $X$ be a proper algebraic variety over a field $k$, and $f:X\rightarrow Y$ a morphism of $k-$schemes with $Y$ affine.
Show $f(X)$ is a finite set of closed points.
This is problem 3.3.19 in Qing Liu's book. I have no idea how to proceed here; there is a hint that says "$f$ factors into $X\rightarrow \operatorname{spec}\mathcal{O}_X(X)\rightarrow Y$" but I can't see what this would be naturally. If we assume $X$ is reduced this could give us that $\operatorname{spec}\mathcal{O}_X(X)$ is the spectrum of some finite dimensional vector space which is finite over $A$ for $\operatorname{spec}(A)=Y$ but it seems like I am just grasping at theorems and getting nowhere.