Let, $f:X \to Y$ be a morphism of schemes with $X$ being both reduced and irreducible.
- If the morphism $f|_{U}$ is constant, $\forall$ affine open $U \subset X$,. Show that $f(x)=f(y), \forall x,y \in X$
- Let $Y=\operatorname{Spec}(A)$ . For every affine open $U=\operatorname{Spec}(B)$ of $X$, the homomorphism $A \to B$ associated to $f|_{U} : U \to Y$ maps inside the subring $\Gamma(X,O_X)$
For Q.1, $X$ is irreducible, so $X$ is connected. So basically have to show that given fixed $x_0 \in X$, $\{x \in X:f(x)=f(x_0)\}$ is both open and closed. Now how to use the affine subsets to glue them together? And also by using the fact that $X$ doesn't have any zero divisors. I'm stuck here.
For Q.2, having no intuition regarding this one!
Thank you for help
For 1., let $x_0 \in X$ and consider the inverse image of the closure of $f(x_0)$: it is a closed subset of $X$ and contains some affine open subset (dense) so is closed. So if $x \in X$, $f(x)$ is a specialization of $f(x_0)$.
As schemes are $T_0$, this shows that $f$ is constant.
For 2, note that if $f$ induces morphisms $f^{\sharp}_{U,V}: \mathcal{O}_Y(V) \rightarrow \mathcal{O}_X(U)$ compatible with restriction for $f(U) \subset V$.
This means that $f^{\sharp}_{Y,U}$ is the composition of the restriction and $f^{\sharp}_{Y,X}$, which makes the claim easy.