So I am having a problem with a following problem:
Let there be matrix $J\in\mathbb{R}^{n\times n}$, which has number $1$ everywhere. Solve the equation for $X$: $J-X=JX$.
I think I have to apply a trace of a matrix, but I am not sure how, since you have a product of matrices on the right side.
Hint: Rewrite the equation as $$ (J+I)X=J $$ and show that $\det(J+I)\neq 0$, so that $$ X=(J+I)^{-1}J. $$ There is no need of trace.
The determinant of a matrix with all non-diagonal coefficients equal to $1$ and diagonal $2$ has been computed at this site, see for example here:
Determinant of a specially structured matrix ($a$'s on the diagonal, all other entries equal to $b$)
Finding determinant for a matrix with one value on the diagonal and another everywhere else