Let A= diag $(d_1, d_2, d_3, ... , d_n)$.
As A is invertible, therefore, det $A \neq 0$
$\Rightarrow \, d_1 \, d_2 \, d_3 ... d_n \neq 0$
$\Rightarrow \, d_i \neq 0$ for $i = 1, 2, 3, ... , n,$
Here, cofactor of each non-diagonal entry is 0 and coafctor of $a_{ij}$
$ = (-1)^{i + i} $ det (diag ${d_1, d_2 ,......, d_{i-1} , d_{i +1}, ...., d_n)}$
$ = d_1 d_2 ...... d_{i-1} d_{i+1} .... d_n$
$ = \frac{1}{d_i} (d_1 d_2 ... d_{i-1} d_i d_{i+1} .... d_n) = \frac{|A|}{d_i}$
$\therefore \, A^{-1} = \frac{1}{|A|} \left(\text{adj} A\right) = \text{diag} \left(\frac{1}{d_{1} }, \frac{1}{d_{2} },...., \frac{1}{d_{n}}\right) $ which is a diagonal matrix.