The flaking is likely a sign of a skin infection, lice or mites. Rather than guess, take your guinea pig to a veterinarian who handles exotics so that the animal can get the proper diagnosis and treatment.
For some reason, guinea pigs tend to have many skin problems. Taking the pig to the vet to get some kind of treatment would be your best option. The tend to give you a bath treatment called sulfer to bath the pig in. Contact your local vet.