Let $A=(a_{i,j})$ be a square matrix of size $n$. Define $$\operatorname{tr} A :=\sum_{i=1}a_{i,i}=a_{1,1}+a_{2,2}+\cdots+a_{n,n}$$
(a) Show that $\operatorname{tr}(AB) = \operatorname{tr}(BA)$ for any square matrices $A,B$ of size $n$.
(b) Let $B$ be an invertible square matrix of size $n$. Show that $$\operatorname{tr} \left( B^{-1} A B \right) = \operatorname{tr}A$$
How do I do this? Sorry for posting without doing any work but I have completely no idea how to even start.
Let $C=AB.$ Then $c_{ij} = \sum_{k=1}^n a_{ik} b_{kj}.$
So $\operatorname{tr}(C) = \sum_{i=1}^n c_{ii} = \sum_{i=1}^n \left( \sum_{k=1}^n a_{ik} b_{ki}\right).$
Now do the same thing with $BA$ and observe that you get the same result.
You ought to be more specific about where your difficulty lies before you can expect more than what is above as an answer.
As for $\operatorname{tr}(B^{-1}AB),$ it is $\operatorname{tr}\Big( \big(B^{-1}\big)\big(AB\big) \Big).$ What was done above says you can interchange the order of multiplitation of the two matrices in the $\big( \text{intermediate-sized round brackets} \big)$ and get $\operatorname{tr}\Big( \big(AB\big)\big(B^{-1}\big)\Big).$ Then simplify that.