<s>[INST] How to find Basis of vector space of real $n \times n$ matrices $V$ is vector space of real $n \times n$ matrices and $W$ is a set of elements of $A$ with trace equal to zero.  How can we find the basis of $W$?
I have seen a few questions previously posted including one that was identical with the exception that it considered only $2 \times 2$ matrices. 
I have tried to use the logic derived from them and worked out the following solution: 
The dimension of the basis of $W$ will be $n-1$. The basis will have $n \times n$ matrices of form 
Mi  = { a11 = 1, all elements except  ai +1 i + 1 =0, ai +1 i + 1 = -1} . So M1 = {a11 = 1, a22 = -1, rest all elements = 0}
Please correct me if I'm wrong.
 [/INST] Your answer is partially correct. For instance 
$$
A=\left( {\begin{array}{*{20}{c}}
   2 & 0 & 1  \\
   0 & { - 1} & 0  \\
   0 & 0 & { - 1}  \\
\end{array}} \right) \in M_3
$$
is not in the span of your basis because $a_{1,3} \ne 0$ but $trace(A)=0$. When $n=2$ your subspace is
$$\begin{align} M_2 &=\left\{  \left( {\begin{array}{*{20}{c}}
   a & b  \\
   c & d  \\
\end{array}} \right) | a,b,c,d \in \mathbb{R},a+d=0
  \right\} \\
&=\left\{  \left( {\begin{array}{*{20}{c}}
   a & b  \\
   c & {-a}  \\
\end{array}} \right) | a,b,c \in \mathbb{R}
  \right\} \\
&=\left\{ a \left( {\begin{array}{*{20}{c}}
   1 & 0  \\
   0 & {-1}  \\
\end{array}} \right) + b\left( {\begin{array}{*{20}{c}}
   0 & 1  \\
   0 & 0  \\
\end{array}} \right)+
c\left( {\begin{array}{*{20}{c}}
   0 & 0  \\
   1 & 0  \\
\end{array}} \right)| a,b,c \in \mathbb{R}
  \right\}  
\end{align}$$
so a a natural basis for $M_2$ is 
$$B=\left\langle   \left( {\begin{array}{*{20}{c}}
   1 & 0  \\
   0 & {-1}  \\
\end{array}} \right), \left( {\begin{array}{*{20}{c}}
   0 & 1  \\
   0 & 0  \\
\end{array}} \right),
\left( {\begin{array}{*{20}{c}}
   0 & 0  \\
   1 & 0  \\
\end{array}} \right)
   \right\rangle.$$
So $dim(M_2)=3=2*2-1$. To extend above idea, we have for $n \in \mathbb{N}$ 
$$\begin{align} M_n &=\left\{  \left( {\begin{array}{*{20}{c}}
   {{a_{1,1}}} &  \cdots  & {{a_{1,n}}}  \\
    \vdots  &  \ddots  &  \vdots   \\
   {{a_{n,1}}} &  \cdots  & {{a_{n,n}}}  \\
\end{array}} \right) | \sum\limits_{j=1}^{n}{a_{j,j}}=0
 \right\} \\
&=\left\{  \left( {\begin{array}{*{20}{c}}
   {{a_{1,1}}} &  \cdots  & {{a_{1,n}}}  \\
    \vdots  &  \ddots  &  \vdots   \\
   {{a_{n,1}}} &  \cdots  & {{a_{n,n}}}  \\
\end{array}} \right) | a_{n,n}=-\sum\limits_{j=1}^{n-1}{a_{j,j}}
 \right\} \\
&=\left\{  \left( {\begin{array}{*{20}{c}}
   {{a_{1,1}}} &  \cdots  & {{a_{1,n}}}  \\
    \vdots  &  \ddots  &  \vdots   \\
   {{a_{n,1}}} &  \cdots  & {{\sum\limits_{j=1}^{n-1}{-a_{j,j}}}}  \\
\end{array}} \right)
 \right\} \\
&=\left\{ {{a_{1,1}}\left( {\begin{array}{*{20}{c}}
   1 & 0 &  \cdots  & 0  \\
   0 &  \vdots  &  \vdots  &  \vdots   \\
    \vdots  &  \vdots  &  \vdots  & 0  \\
   0 &  \ldots  & 0 & { - 1}  \\
\end{array}} \right) + {a_{1,2}}\left( {\begin{array}{*{20}{c}}
   0 & 1 & 0 & 0  \\
   0 & 0 &  \vdots  &  \vdots   \\
    \vdots  &  \vdots  &  \vdots  & 0  \\
   0 &  \ldots  & 0 & { - 1}  \\
\end{array}} \right) +  \cdots  + {a_{n,n - 1}}\left( {\begin{array}{*{20}{c}}
   0 & 0 &  \cdots  & 0  \\
   0 &  \vdots  &  \vdots  &  \vdots   \\
    \vdots  &  \vdots  & 0 & 0  \\
   0 &  \vdots  & 1 & { - 1}  \\
\end{array}} \right)} \right\}
\end{align}
$$
and a natural basis for $M_n$ is
$$B={\left\langle {\left( {\begin{array}{*{20}{c}}
   1 & 0 &  \cdots  & 0  \\
   0 &  \vdots  &  \vdots  &  \vdots   \\
    \vdots  &  \vdots  &  \vdots  & 0  \\
   0 &  \ldots  & 0 & { - 1}  \\
\end{array}} \right),\left( {\begin{array}{*{20}{c}}
   0 & 1 & 0 & 0  \\
   0 & 0 &  \vdots  &  \vdots   \\
    \vdots  &  \vdots  &  \vdots  & 0  \\
   0 &  \ldots  & 0 & { - 1}  \\
\end{array}} \right), \cdots ,\left( {\begin{array}{*{20}{c}}
   0 & 0 &  \cdots  & 0  \\
   0 &  \vdots  &  \vdots  &  \vdots   \\
    \vdots  &  \vdots  & 0 & 0  \\
   0 &  \vdots  & 1 & { - 1}  \\
\end{array}} \right)} \right\rangle }
$$
hence $dim(M_n)=n^2 -1$.
</s>