4x4  INVERSE 
BY BLOCKS DECOMPOSITION

BD[MA_,MB_,MC_,MD_]:=MatrixForm[{"M="MatrixForm[M],"BLOCKS DECOMPOSITIONS",
MatrixForm[{{
"A="MatrixForm[MA], If[Det[MA]==0,"NOT INVERTIBLE","Inverse[A] ="MatrixForm[Inverse[MA]]],",",
"B="MatrixForm[MB], If[Det[MB]==0,"NOT INVERTIBLE",",","Inverse[B] ="MatrixForm[Inverse[MA]]]},
{"C="MatrixForm[MC], If[Det[MC]==0,"NOT INVERTIBLE","Inverse[C] ="MatrixForm[Inverse[MA]]],",",
"D="MatrixForm[MD], If[Det[MD]==0,"NOT INVERTIBLE","Inverse[D] ="MatrixForm[Inverse[MD]]]}}],
If[Det[M]==0,"THE MATRIX M IS NOT INVERTIBLE",MatrixForm[{
{If[Det[MD]==0,
"Atilde = "  - MatrixForm[Inverse[MC].MD.Inverse[MB-MA.Inverse[MC].MD]],"Atilde = " MatrixForm[Inverse[MA-MB.Inverse[MD].MC]]],",",
If[Det[MB]==0,
"Btilde = "  - MatrixForm[Inverse[MA].MB.Inverse[MD-MC.Inverse[MA].MB]],"Btilde = " MatrixForm[Inverse[MC-MD.Inverse[MB].MA]]]
},
{If[Det[MC]==0,
"Ctilde = "  - MatrixForm[Inverse[MD].MC.Inverse[MA-MB.Inverse[MD].MC]],"Ctilde = " MatrixForm[Inverse[MB-MA.Inverse[MC].MD]]],",",
If[Det[MA]==0,
"Dtilde = "  - MatrixForm[Inverse[MB].MA.Inverse[MC-MD.Inverse[MB].MA]],"Dtilde = " MatrixForm[Inverse[MD-MC.Inverse[MA].MB]]]
}
}]],
If[Det[M]==0, "--------","THE INVERSE OF THE MATRIX M IS:"
MatrixForm[Inverse[M]]]
}]

(* INSERT THE M MATRIX *)
M:={{1,2,1,1},{1,1,1,1},{2,2,1,0},{2,2,0,2}}

MA:={{M[[1]][[1]],M[[1]][[2]]},{M[[2]][[1]],M[[2]][[2]]}}
MB:={{M[[1]][[3]],M[[1]][[4]]},{M[[2]][[3]],M[[2]][[4]]}}
MC:={{M[[3]][[1]],M[[3]][[2]]},{M[[4]][[1]],M[[4]][[2]]}}
MD:={{M[[3]][[3]],M[[3]][[4]]},{M[[4]][[3]],M[[4]][[4]]}}

BD[MA,MB,MC,MD]

(* INSERT THE M MATRIX *)
M:={{1,2,1,1},{1,1,1,1},{2,2,1,2},{2,2,0,2}}

MA:={{M[[1]][[1]],M[[1]][[2]]},{M[[2]][[1]],M[[2]][[2]]}}
MB:={{M[[1]][[3]],M[[1]][[4]]},{M[[2]][[3]],M[[2]][[4]]}}
MC:={{M[[3]][[1]],M[[3]][[2]]},{M[[4]][[1]],M[[4]][[2]]}}
MD:={{M[[3]][[3]],M[[3]][[4]]},{M[[4]][[3]],M[[4]][[4]]}}

BD[MA,MB,MC,MD]