Let $k$ be a field. Let $X$ be a (non empty) connected proper $k$-scheme. I would like to prove the maximum principle, that is for any $k$-morphism $\varphi \colon X \to \mathbb A_k^1$, the image of $\varphi$ is a closed point.
From a previous result, as $\mathbb A_k^1$ is a separated $k$-scheme, I already know that $\varphi(X)$ is closed in the affine line. It remains to show that $\varphi(X)$ is a single point. I have no clue…
I tried to exploit the fact that a morphism $\varphi \colon X \to \mathbb A_k^1$ is given by a morphism $k[T] \to \mathscr O_X(X)$ (via the left adjoint of the inclusion of affine schemes into the locally ringed spaces) and it lead me to exhibit $\varphi$ as follow : there is an global section $f \in \mathscr O_X(X)$ such that for all $x \in X$, $$\varphi(x) = \ker (k[T] \to \kappa(x) \colon Q \mapsto Q(f)) .$$ But I don't see why this prime ideal of $k[T]$ wouldn't change with respect to $x$.
First we claim that the image of $\varphi$ cannot be all of $\Bbb{A}^1$. If it were all of $\Bbb{A}^1$, by composing with $\Bbb{A}^1 \hookrightarrow \Bbb{P}^1$ we get a dominant map $X \to \Bbb{P}^1$ that is furthermore proper and thus has closed image. But now this means the map $X \to \Bbb{P}^1$ is surjective, a contradiction.
So we know the image of $\varphi$ is a proper closed subset of $\Bbb{A}^1$. It is now enough to observe that the image of a connected set under a continuous function is also connected. For then the only connected proper closed subset of $\Bbb{A}^1_k$ is a one point set.
Added: Why is $X \to \Bbb{P}^1$ proper?
Well this comes from the famous "Property $\mathscr{P}$" exercise: