This question is in a sense a follow-up and extension of this one, which essentially asks for representations of complex numbers $a + bi \in \Bbb C$ as $2 \times 2$ real matrices $A$ such that
$AJ = JA, \tag 1$
with
$J = \begin{bmatrix} 0 & 1 \\ -1 & 0 \end{bmatrix}; \tag 2$
we observe that
$J^2 = - I. \tag 3$
The answer I gave there showed that all such matrices are given by
$A \in aI + bJ \in M_{2 \times 2}(\Bbb R); \tag 4$
here we clearly have
$a, b \in \Bbb R, \tag 5$
and the correspondence 'twixt complex numbers and such matrices is given by
$\Bbb C \ni a + bi \longleftrightarrow aI + bJ \in M_{2 \times 2}(\Bbb R). \tag 6$
Seeking a generalization of these results, I here request that
1.) All real $2 \times 2$ matrices satisfying (3) be found;
2.) For any such $J$ as in request (1.), all real matrices $A$ such that (1) binds be found;
3.) For any such $J$, $A$ as in request (2.),
$A = aI + bJ, \tag 7$
for some $a, b \in \Bbb R$ be shown;
4.) The mapping
$a + bi \longleftrightarrow aI + bJ \tag 8$
is an isomorphism 'twixt the complex numbers $\Bbb C$ and the set of $2 \times 2$ real matrices of the form $aI + bJ$.
Let us define $Z=\begin{bmatrix}0& -1\\ 1&0\end{bmatrix}$ for simplicity.
[1] Directly, any matrix of the following form for any real $a,k$: $$J=\begin{bmatrix}a& -(a^2+1)/k\\ k&-a\end{bmatrix}$$ For completeness, consider a matrix $$J=\begin{bmatrix}a&b\\c&d\end{bmatrix}$$ such that $J^2=-I$. We can directly solve this: $a^2+bc =-1;\ d^2+bc = -1;\ b(a+d)=0;\ c(a+d)=0$. If $a+d$ is non-zero, then $b=c=0$ by the last two equations, and no solution exists for $a^2=-1$. Otherwise, we have $d=-a$, and can parametrize the solutions as done above.
More elegantly, for any invertible $X$, $$J=\pm X^{-1}Z X$$ fits in (3); for positive $k$, we can just plug in $$X=\begin{bmatrix}a/\sqrt{k}& 1/\sqrt{k}\\ \sqrt{k}&0\end{bmatrix}$$ to recover the above characterization, so this covers all possible $J$
[2] (Using conjugacy classes, this is essentially the same as the case with $J=Z$ itself.)
More precisely, if $A$ commutes with $J$, let $B=XAX^{-1}$ (i.e. $A=X^{-1}BX$), then $$AX^{-1}Z X = X^{-1} B Z X$$ $$X^{-1}Z XA = X^{-1} Z B X$$ And these two are only equal when $B$ commutes with $Z$. Therefore, relying on your previous results, the commuting matrices are $$A=X^{-1}(aI+bZ)X$$
[3] Directly follows from the above.
[4] This should be simple to check, given the above properties. $I$ and $J$ are always linearly independent because the trace of one of them is zero and the other is not.