Solution (source code)

= Solution

Label the two charts of the <affine line with doubled origin> by $A,B$, and use $t$ for their common coordinate. Let $u:T=\operatorname{Spec}R\to X$ be an $R$-valued element of the <functor of points>. Its composite with $\phi$ corresponds to a unique $r\in R$ under the <affine-target adjunction for schemes>:
$$
\phi u:T\longrightarrow\mathbb A^1_{\mathbb Z},\qquad t\longmapsto r.
$$
The <closed subscheme> $Z=V(r)=\operatorname{Spec}(R/(r))$ maps into the disjoint union of the two zero sections,
$$
X\times_{\mathbb A^1_{\mathbb Z}}\operatorname{Spec}\mathbb Z
=A_0\sqcup B_0,\qquad A_0\cong B_0\cong\operatorname{Spec}\mathbb Z.
$$
The inverse image $Z_A$ of $A_0$ is a <clopen set> in $Z$. By the <idempotent–clopen correspondence>, it determines a unique <idempotent> $e\in R/(r)$, equal to $1$ on $Z_A$ and $0$ on the inverse image $Z_B$ of $B_0$. Hence
$$
\boxed{u\longmapsto(r,e)\in F(R),\qquad D_Z(e)=Z_A.}
$$
Over $\mathbb Z$, the two “origins” are entire zero sections, rather than single closed points; this construction uses their full <scheme-theoretic fibers>.