$\newcommand{\tr}{\operatorname{tr}}$For $A =$ zero matrix, $$W=\{ A \in M_{nn} : \tr(A) = 0 \}$$ I can proof that the set of all n x n matrices A with $\tr(A)=0$ is a subset of $M_{nn} $for$ \ n \geq 2$
Since $A=0$ the set is clearly non-empty
Closed under addition: $$ \tr(A + B)=\sum_{i=1}^{n} (A + B)_{ii} =\sum_{i=1}^{n} (A)_{ii} + \sum_{i=1}^{n} (B)_{ii} = 0 + 0 = 0 $$ so,$$ A + B \in W $$
Closed under scalar multiplication ($k \in R$): $$ \tr(kA)=\sum_{i=1}^n (kA)_{ii} =k \sum_{i=1}^n (A)_{ii} =k(0) = 0 $$ so, $$ kA \in W $$ But how do I proof for the cases where A is not the zero vector but $\tr(A)= 0$, or is it unnecessary to confirm this for the other cases?
$\DeclareMathOperator{\tr}{tr}$What you did is exactly what you are searching for , but let me agian organize and clarify your idea.
Let $\mathfrak{A}=\{ A \in M_{n \times n } \mid tr(A)= 0\} $, with $n \geq 2$.
Closed under addition: Let $A, B \in \mathfrak{A} $, then $ tr(A)=tr(B)=0$. On the other hand $$ \tr(A + B)=\sum_{i=1}^{n} (A + B)_{ii} =\sum_{i=1}^{n} (A)_{ii} + \sum_{i=1}^{n} (B)_{ii} = 0 + 0 = 0 $$ so,$$ A + B \in \mathfrak{A} $$
Closed under scalar multiplication ($k \in \mathbb{R}$): $$ \tr(kA)=\sum_{i=1}^n (kA)_{ii} =k \sum_{i=1}^n (A)_{ii} =k(0) = 0 $$ so, $$ kA \in \mathfrak{A} $$ Thus $\mathfrak{A} $ is vector subspace of $ M_{n\times n }$.