There are several misstatements and one error in your solution, though the idea is essentially correct.
First, it is false that if the matrix has rank $m$ then "the number of leading ones are he same as the columns." The matrix $A$ may have no "leading ones" whatsoever. What you meant, presumably, is that the *row-echelon form (or the row-reduced form) of $A$ will have as many leading $1$s as there are columns.
Second: determinants exist for square matrices regardless of the form of the row-echelon form; the determinant of a square matrix is nonzero if and only if the matrix is invertible, if and only if the number of leading $1$s in the row-echelon form of $A$ equals the number of columns. This has to be proven in some way; for example: the elementary row operations will either multiply the determinant by $-1$ in the case of row exchanges, will multiply it by a nonzero constant $\alpha$ in the case of multiplying a row by $\alpha\neq 0$, or will leave the determinant without change in the case that you add the multiple of one row to another row. Thus, performing elementary row operations will not change whether the determinant is or is not equal to $0$, in the sense that if you obtain $B$ from $A$ by a finite sequence of elementary row operations, then $\det(A)=0$ if and only if $\det(B)=0$. Since the determinant of an upper triangular matrix is just the product of the diagonal entries, the determinant of a square matrix in row echelon form will be $1$ if the leading $1$s are all in the diagonal, and $0$ otherwise. So in your case, the row echelon form of $A$ has nonzero determinant, and therefore (by what we saw before) the determinant of $A$ is nonzero, so $A$ has an inverse.
That said, your next line is incorrect. You go from
\[ A\mathbf{x}=\mathbf{0}\]
to
\[ AA^{-1}\mathbf{x} = \mathbf{0}A^{-1}.\]
This not only does not follow, it does not even make sense! First, because if $A$ is an $m\times m$ matrix, then $\mathbf{x}$ and $\mathbf{0}$ are $m\times 1$ matrices; but for $\mathbf{0}A^{-1}$ to make sense, the number of columns of $\mathbf{0}$ (namely, 1) has to equal the number of rows in $A^{-1}$ (namely $m$); and this is not true unless you are dealing with $1\times 1$ matrices. Second, even if you could multiply both sides by $A^{-1}$ on the right, then you would not get $AA^{-1}\mathbf{x}$ on the left hand side of the equation, you would get $A\mathbf{x}A^{-1}$, and then you need to remember that matrix multiplication is not commutative, so in general you cannot go from $\mathbf{x}A^{-1}$ to $A^{-1}\mathbf{x}$ (as noted above, it may not even make sense to write one of them).
So, you multiplied by $A^{-1}$ on the wrong side, and you did it incorrectly. Rather, you want to multiply by $A^{-1}$ on the left of each side of the equality, not on the right. That is, you want to go from
\[ A\mathbf{x}=\mathbf{0}\]
to
\[ A^{-1}(A\mathbf{x}) = A^{-1}\mathbf{0}.\]
And from here you can proceed as you did.
So... partial, but definitely not full credit.