Let $X$ be a projective, irreducible, reduced scheme over $k$ and $Y$ be an affine $k$-scheme, where $k$ is algebraically closed. Prove that every morphism $f : X → Y$ is constant.
I know that for a general scheme $X$ which is irreducible as well as reduced (and $Y$ is just given to be a scheme i.e. no extra conditions imposed), combined with the fact that $f$ restricted to every affine open subset constant would imply that $f$ is constant . So if I can basically show that restriction of $f$ to every affine open subset is constant, we're done.
Now if in addition $Y$ is assumed to be an affine scheme, say $\operatorname{Spec}(R_1)$ then take any affine open subset say $\operatorname{Spec}(R_2) \subset X$ , then the homomorphism induced on the rings $R_2 \to R_1$ associated from the restriction of the morphism to the affine open subset, goes in the global section of the structure sheaf.
How to maybe combine these with the $k-scheme$ structure and also how to use the fact that our $X$ is also projective and a scheme over $k$.
Thanks for help.