There are well-described methods of generalizing arbitrary functions to matrices in a natural way.
Basically, if $A=PD_AP^{-1}$ where $D_A$ is a diagonal matrix, then $f(A)=Pf(D_A)P^{-1}$, where the function $f$ is applied to the diagonal matrix element-wise.
This is automatized in some CAS systems, such as Mathematica, so one can apply arbitrary functions to matrices.
For instance, it can be applied to the Sign
function with MatrixFunction[Sign, A]
. It should be noted that this function is defined on the complex plane as $z/|z|$ and $\operatorname{sign} 0=0$, which is different from some other definitions (Higham - What Is the Matrix Sign Function? also talks about generalizing the sign function to matrices, but it seems they use a different definition).
For instance, this method gives $$\operatorname{sign}\left( \begin{array}{cc} 1 & -8 \\ 1 & 7 \\ \end{array} \right)=1$$ (e.g., produces an identity matrix) but $$\operatorname{sign}\left( \begin{array}{cc} 1 & -8 \\ -1 & 7 \\ \end{array} \right)=\left( \begin{array}{cc} -\frac{3}{\sqrt{17}} & -\frac{8}{\sqrt{17}} \\ -\frac{1}{\sqrt{17}} & \frac{3}{\sqrt{17}} \\ \end{array} \right).$$
The function can be even applied to some zero divisors.
It also can be applied to hypercomplex numbers represented in matrix form. Now, I noticed that while $\operatorname{sign} z$ can take infinitely-many values on the complex numbers, it can take only 9 values on split-complex numbers: $0$, $1$, $-1$, $j$, $-j$, $1/2+j/2$, $1/2-j/2$, $-1/2+j/2$, $-1/2-j/2$. When applied to dual numbers, it seems to give 5 different values.
The usual rule $\operatorname{sign} (AB)=\operatorname{sign} A\cdot \operatorname{sign} B$ still holds though.
That said, I wonder, whether it has any fundamental importance (telling us about the properties of the ring), whether a ring has finite (as split-complex numbers) or infinite (as complex numbers) set of possible values of the sign function? Can this numerocity be predicted?
What about the $p$-adic rings, can the sign function be generalized there as well?