Let $\psi\colon g_X \rightarrow g_Y$ be a natural transformation. We construct a morphism $f\colon X \rightarrow Y$ inducing $\psi$ as follows.
Let $(U_i)_{i \in I}$ be an affine open cover of $X$. Let $\tau_i\colon U_i \rightarrow X$ be the canonical morphism. Let $f_i = \psi_{U_i}(\tau_i) \colon U_i \rightarrow Y$. We get the following commutative diagram.
$\begin{matrix} g_X(U_i)&\stackrel{\psi_{U_i}}{\rightarrow}&g_Y(U_i)\\ \downarrow&&\downarrow\\ g_X(U_i\cap U_j)&\stackrel{\psi_{U_i\cap U_j}}{\rightarrow}&g_Y(U_i\cap U_j) \end{matrix} $
By the above diagram, $f_i = f_j$ on $U_i \cap U_j$. Hence there exists a unique morphism $f\colon X \rightarrow Y$ such that $f|U_i = f_i$.
Let $S$ be an affine scheme, $h\colon S \rightarrow X$ a morphism. We will show $fh = \psi_S(h)$. Let $x \in S$. There exists $i \in I$ such that $h(x) \in U_i$. Since $h$ is continuous, there exists an affine open neighborhood $V_x$ of $x$ such that $h(V_x) \subset U_i$. Hence there exists an affine open cover $(V_j)_{j\in J}$ with the following property. For each $j \in J$, there exists $i \in I$ such that $h(V_j) \subset U_i$. Hence there exists a map $\phi\colon J \rightarrow I$ such that $h(V_j) \subset U_{\phi(j)}$ for each $j \in J$. Let $h'_j\colon V_j \rightarrow U_{\phi(j)}$ be the morphism induced by $h$. Let $h_j = \tau_{\phi(j)} h'_j \colon V_j \rightarrow X$.
$\begin{matrix} g_X(U_{\phi(j)})&\stackrel{\psi_{U_{\phi(j)}}}{\rightarrow}&g_Y(U_{\phi(j)})\\ \downarrow&&\downarrow\\ g_X(V_j)&\stackrel{\psi_{V_j}}{\rightarrow}&g_Y(V_j) \end{matrix} $
By the above commutative diagram, $\psi_{V_j}(h_j) = fh_j$.
$\begin{matrix} g_X(S)&\stackrel{\psi_S}{\rightarrow}&g_Y(S)\\ \downarrow&&\downarrow\\ g_X(V_j)&\stackrel{\psi_{V_j}}{\rightarrow}&g_Y(V_j) \end{matrix} $
By the above commutative diagram, $\psi_S(h)|V_j = fh|V_j$ for each $j \in J$. Hence $\psi_S(h) = fh$. Therefore $f$ induces $\psi$.
Suppose $\psi\colon g_X \rightarrow g_Y$ is a natural equivalence. Then, by the above argument, there exists a morphism $f'\colon Y \rightarrow X$ inducing $\psi^{-1}$. Since $f'f$ induces the identity on $h_X$, $f'f = id_X$. Similarly $ff' = id_Y$. Hence $f$ is an isomorphism.