There are two relatively common complaints seen in the ears of guinea pigs. One is parasitic infestation and the other is bacterial infection of the inner ear.
The behavioural symptoms of parasitic infestation are frantic scratching of the ear and head shaking. Upon examination of the ear there is either much wax in it, which of course attracts the parasites, or the skin is very dry and scurfy. If it is not treated the parasites quickly extend their territory to the other ear.
One of the best treatments for this is Otodex eardrops, formulated for use upon cats and dogs but perfectly safe and effective for guinea pigs.
Towel wrap the guinea pig and if there is wax in the ear clean out as much as you can with a cotton bud, put a few drops of Otodex into the ear then massage at the base of the ear. Do this a couple of times a day for about three days, it seldom takes longer than that to clear the problem up.
Infections of the inner ear are indicated by the guinea pig inclining it's head to one side. When the ear is firmly palpated the guinea pig will usually flinch the closer you get the base of the ear. There may even be puss inside the ear and if there isn't, quite often there is the odour of it. There are a few prescription only antibiotic drops that can deal with these infections quite easily and it is important that it is treated as soon as possible so a visit to a vet will be necessary.
Keeping the ears clean and wax free will help to avoid ear problems. The most effective dewaxing solution is Dermisol fluid.