Given that $A$ and $B$ are two square matrices with the same size.
Let $B$ be invertible.
Now, $$\quad(I+B A)^{-1}=2 B^2$$
$$
\begin{aligned}
& \Rightarrow\left((1+B A)^{-1}\right)^{-1}=\left(2 B^2\right)^{-1} \\
& \Rightarrow \quad 1+B A=\frac{1}{2} B^{-2} \\
& \Rightarrow B A=\frac{1}{2} B^{-2}-1 \\
& \therefore A=\left(\frac{1}{2}\right) B^{-3}-B^{-1}
\end{aligned}
$$