I'm trying to prove that $\det \colon \operatorname{GL}_n \to U$ is a natural transformation of functors $U, \operatorname{GL}_n \colon \operatorname{CRing} \to \operatorname{Grp}$ when we specify that $\det_R \colon \operatorname{GL}_n(R) \to U(R)$ sends $A \mapsto \det(A)$.
Here, $U \colon \operatorname{CRing} \to \operatorname{Grp}$ is a functor that sends $R \mapsto R^\times$ (the multiplicative unit group) and, since ring homomorphisms preserve units, $U$ sends a morphism $f \colon R \to S$ to a mophism $U(f) \colon R^\times \to S^\times$, $r \mapsto f(r)$. So, we write $U(f) = f$. The functor $\operatorname{GL}_n \colon \operatorname{CRing} \to \operatorname{Grp}$ simply sends $R \mapsto \operatorname{GL}_n(R)$. Then, a morphism $f \colon R \to S$ is sent to a morphism $\operatorname{GL}_n(f) \colon \operatorname{GL}_n(R) \to \operatorname{GL}_n(S)$ defined by $A = (a_{ij})_{ij} \mapsto (f(a_{ij}))_{ij} =: f(A)$.
I have proved that the above two 'maps' are indeed functors. When I try to prove that $\det$ is a natural transformation, however, I'm stuck on the fact that $U(f)$ is a morphism of $\operatorname{Grp}$; and thus not a ring homomorphism. More specifically, I want to show that for all $A \in \operatorname{GL}_n(R)$ we have $(U(f) \circ \det_R) (A) = (\det_S \circ \operatorname{GL}_n(f))(A)$.
So the problem is: I can only finish this proof when I consider $U(f)$ in $\operatorname{Mor}(\operatorname{Grp})$ as the ring homomorphism $f \colon R \to S$, because in that case $\det$ and $f$ commute (since $\det$ yields a linear combination of elements of ring elements). My question is: is this allowed? Shouldn't I restrict my usage of $U(f)$ to just axioms of a group homomorphism?