What you write does not really make much sense. If you want to use the minimal polynomial and the Cayley-Hamilton theorem, you could argue as follows.
Since $A^m=0$, the minimal polynomial divides $X^m$, so it is of the form $X^r$ (by unique factorisation of polynomials, as $X$ is the only irreducible factor of$~X^m$). By the Cayley-Hamilton theorem, this minimal polynomial $X^r$ divides the characteristic polynomial, which is of degree$~n$. Therefore $r\leq n$.
But maybe you wanted to say the following. Let $p_A$ be the characteristic polynomial, then $p_A[A]=0$ by the Cayley-Hamilton theorem. Also $A^m=0$, so by dividing $p_A$ by $X^m$, one obtains a remainder $r_A$ such that $r_A[A]=0$, and $\deg r_A<n$. Now if $r=0$ it must be that $p_A=X^n$, and one can take $n=r$. However the the case $r_A\neq0$ it is not clear why $r_A$ should be of the form $X^r$; in fact it won't. (In fact one can show that $p_A=X^n$, so the other case does not occur, but I don't see how you could prove that more easily than what you need to prove.)