Let A and B be n x n matrices,

assume AB is invertible and show that both A and B are invertible.

what?

AB is invertible ----->

There exists a matrix X such that:

(AB)X = 1

But (AB)X = A(BX). So,

AY = 1

for Y = BX

Also:

X(AB) = 1

And thus

ZB = 1

for Z = XA