Let $X$ be a nonempty, connected, proper scheme over a field $k$, and $f \in \mathcal{O}_X(X)$ (the global sections of $X$). Let $\varphi : X \to \mathbb{A}^1_k$ be the morphism induced by: $$\begin{align*} k[T] & \to \mathcal{O}_X(X) \\ T & \mapsto f \end{align*}$$
ie. $\varphi$ comes from the isomorphism $\mathrm{Hom}(X, \mathbb{A}^1_k) \simeq \mathrm{Hom}(k[T], \mathcal{O}_X(X))$. I would like to prove:
$\varphi(X)$ is a closed point of $\mathbb{A}^1_k$
Now, thanks to a previous question that I asked, I know that $\varphi(X)$ is a closed subset of $\mathbb{A}^1_k$. It is also connected, as $X$ is connected. Now, the only subsets of $\mathbb{A}^1_k$ matching these requirements are closed singletons and the whole set. So now I'm reduced to showing that there's no surjective morphism $X \to \mathbb{A}^1_k$... And this is where I'm stuck.
Intuitively the problem would come from the fact that $\eta$, the generic point of $\mathbb{A}^1_k$, can't lie in the image of $\varphi$. Let's assume it does, $\varphi(x) = \eta$. This gives rise to an extension $k(T) \hookrightarrow \kappa(x)$, which, given the description of $\varphi$, is $T \mapsto f(x) \in \kappa(x)$, and therefore $f(x)$ is transcendental in $\kappa(x)$. I think I'm not too far from the answer, but I'm stuck.
Your morphism factors through the canonical map $X\rightarrow\mathrm{Spec}(\mathscr{O}_X(X))$ via the map $\mathrm{Spec}(\mathscr{O}_X(X))\rightarrow\mathbf{A}_k^1$ induced by the ring map $T\mapsto f:k[T]\rightarrow\mathscr{O}_X(X)$. So you're reduced to the case $X=\mathrm{Spec}(A)$ a connected, non-empty affine scheme proper over $k$. By properness, $A$ is actually finite over $k$, hence a product of finitely many local $k$-algebras. By connectedness, it is actually local. Thus $\mathrm{Spec}(A)$ is a point ($A$ is an Artin local ring). So the image is a point.
Alternatively, if $f:X\rightarrow Y$ is a surjective morphism of $S$-schemes with $X$ proper over $S$ and $Y$ separated of finite type over $S$, then $Y$ is proper over $S$. Since $\mathbf{A}_k^1$ is not proper over $k$, this gives you what you want as well.
EDIT: I'm using the fact that $X$ is connected if and only if $\mathrm{Spec}(\mathscr{O}_X(X))$ is connected, if and only if $\mathscr{O}_X(X)$ is a connected ring, i.e., it has no non-trivial idempotents.