Assume that $w$ is a probability-vector with positive components and $X$ denotes a matrix of the form $ww^T$, but with zeros on its diagonal. So, $x_{ij} = (1 - \delta_{ij}))w_iw_j$.
Is this matrix invertible in the general case? If so, how to find its inversion?
As fonfonx remarked, you must assume all $w_i \ne 0$. That turns out to be sufficient. In fact, $X^{-1}$ has a closed form:
$$ \eqalign{(X^{-1})_{ii} &= - \frac{n-2}{(n-1) w_i^2}\cr (X^{-1})_{ij} &= \frac{1}{(n-1) w_i w_j} \ \text{otherwise}\cr} $$