Prove that if $ AB^2-A$ is a non singular matrix $BA-A$ is also a non singular matrix. Need help with this problem, tried too many times with failure.

Let $A$ and $B$ be some $n\times n$ matrices. Prove that if$\space$ $ AB^2-A$ $\space$ is a non singular matrix,
$\space$ $BA-A$$\space$  is also a non singular matrix.


Hint. If the question is reformulated as follows, can you solve it?

Let $A$ and $B$ be two square matrices of the same sizes. If $A(B-I)(B+I)$ is nonsingular, prove that $(B-I)A$ is nonsingular.

