Finding dimension of space Let $V = M_n(\mathbb{C})$ and define 
$$
f(A,B) = n\cdot\mathrm{tr}(AB) - \mathrm{tr}(A)\mathrm{tr}(B)\ .
$$
Find $\mathrm{dim} (S)$ where 
$$
S = \left\{ v \in V\ | \ \text{for all}\ u \in V, \ f(v,u) = 0\right\}\ .
$$
I first tried to check some base cases: 
for $n=1$, $f(A,B) = 0$ so $\mathrm{dim}(S) = n = 1$, but for $n>1$ it's not easy to find $\mathrm{dim}(S)$.
So I proved that $f(A,B)$ is symmetric bilinear form over $V$.
Then I tried to prove that $f$ is an inner product, but I didn't manage to prove it and I don't know if this is the right way.
 A: You are looking for the set$~S$ of all matrices $\def\tr{\operatorname{tr}}A\in M_n(\Bbb C)$ such that
$$
  n\tr(AB)=\tr(A)\tr(B)\qquad\text{for all $B\in M_n(\Bbb C)$,}
$$
which as you remarked is a (complex) subspace of $M_n(\Bbb C)$. Note that since $\tr(I_n)=n$, one has $I_n\in S$. So the dimension is at least$~1$.
Now $(A,B)\mapsto \tr(AB)$ is a non-degenerate symmetric bilinear form, as one easily checks (only the zero matrix gives$~0$ with all elementary matrices). If we let $B$ run through the $n^2-1$ dimensional subspace$~T$ of $M_n(\Bbb C)$ of matrices with trace$~0$, we see that $A$ has to be in the orthogonal complement of$~T$ for this form. So $1\leq\dim S\leq n^2-(n^2-1)=1$ and $\dim S=1$.
A: Consider $E_{ij}$ the matrix with zero in every entry except where is takes value $1$ in the $(i,j)$-th component. We can write these as $E_{ij} = e_ie_j^T$ the product of $n \times 1$ and $1 \times n$ standard basis vectors and their transposes. Clearly, $e_i^T e_j = e_i \cdot e_j = \delta_{ij} = \begin{cases} 0 & i \neq j \\ 1 & i=j \end{cases}$. Consider then,
$$ E_{ij}E_{kl} = (e_ie_j^T)(e_ke_l^T) = e_i \delta_{jk}e_l^T = \delta_{jk}E_{il} $$
Any matrix may be written $A = \sum_{ij} A_{ij}E_{ij}$ for appropriate complex scalars $A_{ij}$. Likewise for $B$. Now plug these into the defining condition for $S$ and see what condition this forces on the components $A_{ij}$. Note:
$$ AB = \sum_{ijk} A_{ik}B_{kj}E_{ij}  $$
But, $\text{trace}(C) = \sum_i C_{ii}$ hence
$$ \text{trace}(AB) = \sum_{ik} A_{ik}B_{ki} $$
On the other hand,
$$ \text{trace}(A)\text{trace}(B) = \sum_{i} A_{ii} \sum_k B_{kk} = \sum_{ik}A_{ii}B_{kk} $$
Therefore, in general, $f(A,B)=0$ yields the condition that follows as $n\text{trace}(AB)-\text{trace}(A)\text{trace}(B) = \text{trace}(nAB)-\text{trace}(A)\text{trace}(B)$
$$ 0 = \sum_{ik} (nA_{ik}B_{ki} -A_{ii}  B_{kk}) \qquad \star $$
We want to characterize all $A$ such that $f(A,B)=0$ for all $B$. Therefore, we can choose particular $B$ as to simplify the condition above. For example $B=E_{pq}$ has $\text{trace}(B)=\delta_{pq}$ and $B_{ij} = \delta_{pi}\delta_{qj}$ and it follows that $\star$ reduces to:
$$ 0 = \sum_{ik} (nA_{ik}\delta_{pk}\delta_{qi}  -A_{ii}\delta_{pk}\delta_{qk}  )$$
Therefore, keep in mind $p,q$ are free indices here,
$$ 0 = nA_{qp}  -\text{trace}(A)\delta_{pq}  $$
hence, swapping $p$ with $i$ and $q$ with $j$ we find
$$ A_{ij} = \frac{1}{n}\text{trace}(A)\delta_{ij}$$
Thus, if $f(A,B)=0$ for all $B$ then
$$ A = \sum_{ij} A_{ij}E_{ij} = \sum_{ij}\frac{1}{n}\text{trace}(A)\delta_{ij}E_{ij} =\frac{1}{n}\text{trace}(A) \sum_i E_{ii} = \frac{\text{trace}(A)}{n}I.$$
Thus $S = span(I)$.
So, I bet you're correct, I suspect you could find this from a more clever line of reasoning. Truth is that I happen to enjoy this sort of calculation. 
A: Here is an alternative proof. Consider the inner product $\langle X,Y\rangle=\operatorname{tr}(Y^\ast X)$. If $A\in S$, the given condition says that
$$
\langle A,B\rangle
= \frac1n\langle A,I\rangle\langle I,B\rangle
= \left\langle \frac1n\langle A,I\rangle I,\ B\right\rangle
$$
for all $B\in M_n(\mathbb{C})$. Hence $A=\frac1n\langle A,I\rangle I=\frac1n\operatorname{tr}(A)I$, i.e. $A$ is a scalar multiple of $I$. Therefore $\dim S=1$.
