Gortz-Wedhorn Algebraic Geometry , Proposition 16.54 (I reworded it a bit):
Let $k$ be a field. Let $X$ be a geometrically reduced (so $X \times_k Y$ is reduced), geometrically connected, proper $k$-scheme with a $k$-valued point $x$. Let $Y$ be a reduced $k$-scheme, and $Z$ be a separated $k$-scheme. Let $f : X \times_k Y \rightarrow Z$ be a morphism and suppose that for some $k$-valued points $y \in Y$ and $z \in Z$, if $s \in X \times Y$ is such that $\pi_2(s) =y$, then $f(s) = z$.
Then, $f$ factors through the projection $X \times_k Y \rightarrow Y$.
Proof : Let $x \in X$ be $k$-valued, and also denote the morphism $Spec(k) \rightarrow X$ by $x$. Let $t_x : Y \rightarrow X$ be the composition of the terminal morphism $Y \rightarrow Spec(k)$ and the morphism $x : Spec(k) \rightarrow X$. Let $g = f \circ (t_x, id_Y) \circ \pi_2 : X \times_k Y \rightarrow Z$.
The goal is to show that $eq(f,g)$ has dense range. This is sufficient because $X \times_k Y$ is reduced and $Z$ is separated.
Let $z \in U \subseteq Z$ be an affine open set. Because $X$ is proper over $k$, $\pi_2 : X \times_k Y \rightarrow Y$ is closed , so $\pi_2(f^{-1}(U)^c)$ is a closed set in $Y$ that doesn't contain $y$. Let $V \subseteq Y$ be affine open and disjoint from $\pi_2(f^{-1}(U)^c)$, so $\pi_2^{-1}(V) \subseteq f^{-1}(U)$.
Let $y' \in V \subseteq Y$, and consider $X \times_k Spec(k(y')) \rightarrow X \times_k Y \rightarrow^{f} U$, which also induces a morphism $X \times_k Spec(k(y')) \rightarrow U \times_k Spec(k(y'))$. The global sections of $X \times_k Spec(k(y'))$ is $k(y')$, and since $U \times_k Spec(k(y'))$ is affine, and the affine schemes form a reflective subcategory of all schemes, this morphism factors through some $Spec(k(y')) \rightarrow U \times_k Spec(k(y'))$.
Here is the part that I don't understand. The proof then claims that $eq(f,g)$ contains all points from $\pi_2^{-1}(V)$. I don't understand how this follows from the previous steps.