Does there exist a
commutative ring(-with-a-1) $R$
and
positive integer $n$
and
function $\hspace{.04 in}f$ from [the set of $n$-by-$n$ matrices over $R$] to $R$
such that
$f$ is linear in each row and each column separately
and
$f$ of the $n$-by-$n$ identity matrix is $1_R$
and
for all $n$-by-$n$ matrices $M\hspace{-0.03 in}$, if $M$ is invertible then $\hspace{.04 in}f(M)$ is a unit
and
$f$ is not the restriction of determinant to $\hspace{.04 in}f\hspace{.02 in}$'s domain
?
I'm inspired by this answer.