How to find the inverse of $3\times 3$ block upper triangular matrix
$$X = \begin{bmatrix} \mathbb{1} & \mathbb{B} & 0\\ 0 & \mathbb{1} & \mathbb{B}\\ 0 & 0 & \mathbb{1} \end{bmatrix}$$
where $\mathbb{B}$ is a $3\times 3$ matrix.
Edit:
Is there a general proof for such a problem?
Here's an approach that I have tried. I started by decomposing the matrix into kronecker product of individual matrices.
$$ X = \mathbb{1}_{3x3}\otimes\mathbb{1}_{3x3} + \mathbb{B}_{3x3}\otimes\mathbb{C}_{3x3} $$ where $$ \mathbb{C}_{3x3} = \begin{bmatrix} 0 & 1 & 0\\ 0 & 0 & 1\\ 0 & 0 & 0 \end{bmatrix}$$
First try to have a look at the case that $B$ is $1\times1$.
You should be able to check relatively easily that: $$ \begin{pmatrix} 1 & b & 0 \\ 0 & 1 & b \\ 0 & 0 & 1 \end{pmatrix}^{-1}= \begin{pmatrix} 1 &-b & b^2 \\ 0 & 1 &-b \\ 0 & 0 & 1 \end{pmatrix} $$
Now you only have to check the same pattern works for block matrices consisting of square blocks: $$ \begin{pmatrix} I & B & B^2 \\ 0 & I & B \\ 0 & 0 & I \end{pmatrix}^{-1}= \begin{pmatrix} I &-B & 0 \\ 0 & I &-B \\ 0 & 0 & I \end{pmatrix} $$
Simply check that if you multiply the two matrices, you get the identity matrix.
As you correctly pointed out in your edit, you can rewrite your matrix as $A=I+N$, where $N^3=0$. This means that \begin{align*} (I+N)(I-N+N^2)&=I-N^3=I\\ (I+N)^{-1}&=I-N+N^2 \end{align*} So you get that $A^{-1}=I-N+N^2$.
You can get similar equality for $(I+N)^{-1}$ where $N$ is a nilpotent matrix. See also: