I have two square matrices $A=\begin{bmatrix} a_{11}&a_{12}&0&0\\ a_{21}&a_{22}&0&0\\ 0&0&a_{33}&a_{34}\\ 0&0&a_{43}&a_{44} \end{bmatrix}$ and $B=\begin{bmatrix} b_{11}&0&0&0\\ 0&b_{22}&0&0\\ 0&0&b_{33}&0\\ 0&0&0&b_{44} \end{bmatrix},$which are in product form as shown in the following equation \begin{equation} A^{-1}BA \end{equation} where $B$ is a diagonal positive definite matrix. $A$ can be positive, negative or indefinite matrix.
If the main diagonal elements $B$ are equal (i.e., B is scalar positive definite), then obviously $A^{-1}BA=BI,$ which is a positive definite. But I am not sure what will be the result if $B$ is a diagonal with different elements on its main diagonal?
Counterexample: Take $$ A = \pmatrix{2&1&0&0\\1&2&0&0\\0&0&1&0\\0&0&0&1}, \quad B = \pmatrix{10\\&1\\&&1\\&&&1}. $$ We find that $$ A^{-1}BA = \pmatrix{13&6&0&0\\-6&-2&0&0\\0&0&1&0\\0&0&0&1} $$ has a negative diagonal entry and therefore cannot be positive definite.