Lets take the given matrix
A=⎡⎢⎣10−121−1232⎤⎥⎦
We know that AA−1=I
⎡⎢⎣10−121−1232⎤⎥⎦A−1=⎡⎢⎣100010001⎤⎥⎦
Perform R2→R2−2R1 and R3→R3−2R1
⎡⎢⎣10−1011034⎤⎥⎦A−1=⎡⎢⎣100−210−201⎤⎥⎦
Perform R3→R3−3R2
⎡⎢⎣10−1011001⎤⎥⎦A−1=⎡⎢⎣100−2104−31⎤⎥⎦
Perform R1→R1+R3 and R2→R2−R3
⎡⎢⎣100010001⎤⎥⎦A−1=⎡⎢⎣5−31−64−14−31⎤⎥⎦
⇒[I][A−1]=⎡⎢⎣5−31−64−14−31⎤⎥⎦
∴A−1=⎡⎢⎣5−31−64−14−31⎤⎥⎦
Now, to find matrix B, multiply A2+A+I=BA by A−1 .
⇒A(A.A−1)+A.A−1+I.A−1=B.A.A−1
⇒A+I+A−1=B (∵AA−1=I)
⇒B=⎡⎢⎣10−121−1232⎤⎥⎦+⎡⎢⎣100010001⎤⎥⎦+⎡⎢⎣5−31−64−14−31⎤⎥⎦
⇒B=⎡⎢⎣7−30−46−2604⎤⎥⎦