How is the Ricci scalar $R=0$ here? Given the metric in the form:
$$ds^2 =-A(r)dt^2 +B(r) dr^2 dr^2 +r^2(d\theta ^2 +\sin^2\theta d\phi^2)$$
Papapetrou in his book said that $R=0$
But when I performed it I didn't get zero.
For example for $g^{00} = -1/A$ if $ g^{00}$multiplied by $T_{00}$
How did he get $R=0$? What am I doing wrong?
 A: $$
g_{\mu\nu} = \text{diag}(-A,B,r^2,r^2\sin^2\theta)
$$
$$
g^{\mu\nu} = \text{diag}\left(-\frac{1}{A},\frac{1}{B},\frac{1}{r^2},\frac{1}{r^2\sin^2\theta}\right)
$$
$$
T_{\mu\nu} = \text{diag}(-A,B,-r^2,-r^2\sin^2\theta)\times \frac{Q^2}{32\pi^2r^4}
$$
$$
g^{\mu\nu} T_{\mu\nu} = (1 + 1-1-1)\times \frac{Q^2}{32\pi^2r^4} = 0
$$
A: It seems like you are dealing with charged black holes. For charged black holes in $d$ dimensions, Einstein's equations takes the form
$$
R_{\mu\nu} - \frac{1}{2} g_{\mu\nu} R = T_{\mu\nu}^{EM}
$$
where
$$
T_{\mu\nu}^{EM} = F_{\mu\alpha} F^\alpha{}_\nu - \frac{1}{4} g_{\mu\nu} F_{\alpha\beta} F^{\beta\alpha}
$$
If I contract Einstein's equations with $g^{\mu\nu}$, I get
$$
\left( 1 - \frac{d}{2} \right) R = T^{EM}_\mu{}^\mu
$$
For the electromagnetic stress-tensor, we find
$$
T^{EM}_\mu{}^\mu = \left( 1 - \frac{d}{4} \right) F_{\alpha\beta} F^{\beta\alpha} 
$$
Thus, Einstein's equations reads
$$
\left( 1 - \frac{d}{2} \right) R = \left( 1 - \frac{d}{4} \right) F_{\alpha\beta} F^{\beta\alpha} 
$$
In particular, when we are in $d=4$ (which the case you are interested in), we must have
$$
R = 0
$$
as stated in the book. 
BTW, please note that when one writes $g^{\mu\nu} T_{\mu\nu}$ there is an implicit sum over the $\mu\nu$ indices that is implied. For instance, of the metric is diagonal (as is the case for your problem), then
$$
g^{\mu\nu} T_{\mu\nu} = g^{tt} T_{tt} + g^{rr} T_{rr} + g^{\theta\theta} T_{\theta\theta} + g^{\phi\phi} T_{\phi\phi}
$$
or for more general metrics in matrix notation
$$
g^{\mu\nu} T_{\mu\nu} = \text{Tr} \left[ g^{-1} T \right]
$$
