R program to invert and cache a matrix

This is a functional programming example to cache an inverted matrix