I had start out saying that for A=0 it is pretty trivial that it work.
for A diff of 0 now, B can not be 0 since AB=A.
I'm pretty sure you can't go using only the matrice themself. There is no way you can prove that B or A as an inverse.
I think that you'll have to get your hand dirty and use the value in the matrice. Since we dont know the size you'll also have to work with a (NxN) matrices. You should first try with a 2x2 matrice. (I'm pretty sure it could work there if such a proof exist.)