I started giving names and indexes. $$X = (X)_{ij}$$ $$Y = (Y)_{jk}$$ $$Z = (Z)_{km}$$ so that we have $$(XYZ)_{im} = x_{ij}y_{jk}z_{km}$$ Now I know that for a matrix $A$ the trace would be $Tr(A) = a_{hh}$
So I think $Tr(XYZ) = (XYZ)_{ii}=(XYZ)_{mm}$ and I also ave $Tr(ZXY)_{pq} =(ZXY)_{pp}=(ZXY)_{qq}$.
But how do I prove it? I couldn't go further
EDIT
Everyone in the comments talks about commutativity, so I'll write here the counterexample I gave in one of the comments. Everyone says we can apply it because they are real numbers. True, they are, however consider the following $$\mathbf{y} = \mathbf{A}\mathbf{x} \Longleftrightarrow y_i = a_{ij}x_j$$ Now clearly the entries of the matrix, $a_{ij}$ and of the vector $x_j$ are real numbers. However it is false to say that $a_{ij}x_j = x_ja_{ij}$. Indeed if we take $\mathbf{A}$ to be a $3\times 3$ matrix and $\mathbf{x}$ to be a $3\times 1$ vector, then the multiplication $\mathbf{x}\mathbf{A} = x_ja_{ij}$ makes no sense
Lets prove $tr(AB) = tr(BA)$.
$ (AB)_{i,j} = \sum_{k}A_{ik}B_{kj}$
$(BA)_{ij} = \sum_{k}B_{ik}A_{kj}$
Now
$tr(AB) = \sum_{i}(AB)_{ii} = \sum_{i}\sum_{k}A_{ik}B_{ki}$
Now since all sums are finite, we can interchange the sums over $i$ and $k$ and since $A_{ik}$ and $B_{ki}$ are just numbers and hence commute, we can interchange them too. Hence the above expression is equal to
$\sum_{k}\sum_{i}B_{ki}A_{ik}$
which is equal to
$\sum_{k}(BA)_{kk}$
which is just $tr(BA)$.
Let me know is something is unclear.
Remark: It is crucial that we have finite sums here. Infinite sums cannot in general be interchanged like this. Also crucial is that $A_{ik}B_{ki}$ commute; note that even though $A$ and $B$ are matrices, $A_{ik}$ and $B_{ki}$ are numbers (or elements of a commutative ring, as the case maybe) and hence they commute even though matrices $A$ and $B$ may not.