Let V be a vector space in which $A$ is a $2$ by $2$ matrix. In this space, $AB$ $=$ $BA$, where B is $\begin{pmatrix}0&1\\ -1&0\end{pmatrix}$. Find a Basis for V.
So I let $A$ $=$ $\begin{pmatrix}a&b\\ c&d\end{pmatrix}$.
Therefore, $AB$ $=$ $\begin{pmatrix}-b&a\\ -d&c\end{pmatrix}$ and $BA$ $=$ $\begin{pmatrix}c&d\\ -a&-b\end{pmatrix}$.
This led to me getting a general form of $A$ of $\begin{pmatrix}a&b\\ -b&a\end{pmatrix}$.
So I thought that every matrix $A$ could be written in the form $a\begin{pmatrix}1&0\\ 0&1\end{pmatrix}+b\begin{pmatrix}0&1\\ -1&0\end{pmatrix}$.
So a basis would be $\left\{\begin{pmatrix}1&0\\ \:0&1\end{pmatrix},\begin{pmatrix}0&1\\ \:-1&0\end{pmatrix}\:\right\}$.
But I am not entirely sure if this approach is correct since the matrix $B$ is fixed.
Any help?
Yes your derivation is correct, you have found a basis and the dimension of that space is $2$.
The fact that B is fixed doesn't matter. We only need it is a subspace and of course that condition is fulfilled.