I don't know what the law is, but when I was on Cuba, I always left my passport in the hotel safe and carried a copy. I spent some hours in a police station in Havana but I don't think anybody ever wanted to see my passport.
Many Europeans also have an identity card, I often carry that with me as a form of authentication. It doesn't help you to get into the country, but it is a legal document and can be helpful if you have to deal with the authorities.
I actually asked this question a few months ago to a representative of a Cuban consulate. She told me that it is a good idea to use a photocopy of the passport, but only if I can provide some other additional indentification with a picture, like a health insurance card, a driver license, a resident card etc. However, if you ever need to do a currency exchange on cash, you will have to show your actual passport.