Let $A$ be an arbitrary $n\times n$ matrix over $\mathbb{C}$ and define the linear transformation $T:F^{n\times n}\rightarrow F^{n\times n}\text{,}\quad T(B)=AB-BA$.
I want to prove that $\dim \operatorname{Im}(T)\leq n^{2}-n$
The rank nullity theorem gives $\dim\operatorname{Im}(T)=n^{2}-\dim \operatorname{Ker}(T)$, so this is equivalent to proving that $\dim \operatorname{Ker}(T)\geq n$, i.e. the subspace of matrices commuting with $A$ is at least $n$ dimensional.
In the case that $A$ is diagonalizable, it isn't too hard to show that $n\leq \dim\operatorname{Ker}(T)\leq n^{2}$, the minimal case occuring for $A$ having $n$ distinct eigenvalues (in this caase the kernel is the subspace of diagonal matrices), and the maximal case provided by $A=I$.
It is the general/non diagonalisable case I'm not sure on, and any hints or pointers would be appreciated.
I'm not sure how relevant it is, but by noting that $T(A)=T(0)=0$, while $A\neq 0$ in general we see that $T$ is not injective, so $\det T(B)=0$.