Try adding something that makes it go pink, and then something that makes it go blue or vice-versa.
What is going on?
In the red cabbage there are pigments that are very similar to those in litmus that you may have used in experiments at school.
You will probably have noticed that things with a sharp, sour taste caused it to go pink, these are called acids. Things with a chalky taste made it go blue and are called alkalis.
Acids and Alkalis are the opposite of each other and will cancel each other out, so if you add enough acid to something that is normally an alkali it will become acid and turn the cabbage pink, but if you add enough alkali to an acid solution the solution will become alkali and become blue.
Why does it fizz if you add an acid to bicarbonate of soda?
Bicarbonate of soda or Sodium bicarbonate is a special type of alkali, it is a type of carbonate. This means that it has carbon dioxide gas locked up inside it very tightly which is released as lots of bubbles when you add an acid.
Carbonate + Acid -> Carbon Dioxide + Water
HCO3- + H+ -> CO2 + H2O
Why is red cabbage called red cabbage not purple cabbage?
When you cook the red cabbage it will change colour from purple to red, because it becomes more acidic, causing it to change colour. This is why it is called red cabbage and not purple cabbage.
What is happening to the molecules?
Acids are things that have lots of free H+ ions (an ion is just a molecule that is positively or negatively charged) floating around, eg hydrochloric acid - HCl will break up in water (dissasociate) into H+ and Cl- ions.
Acidity is measured on the pH scale which is a measure of how many H+ ions there are in the solution, the lower the number the more H+ ions. Pure water has some H+ ions because water will split up occasionally too.
H2O -> H+ + OH-
Alkalis have lots of OH- ions which will react with the H+ ions forming water again,
H+ + OH- -> H2O
This reduces the number of H+ ions and makes the solution less acidic.
Why does red cabbage change colour?
It contains a type of anthocyanin pigment, these are very common in plants and are used to protect the plants from ultraviolet radiation. This has two forms; one with a hydrogen atom attached (which is more common in an acid because there are lots of H+ ions around), and one where it has fallen off which is more common in an alkali.
The pigment will look blue if it absorbs reddish long wavelength light, and look red if it absorbs blue and green shorter wavelength light.
In the Alkali form the electrons can move further than in the Acid form and so act like a large aerial and absorb long wavelength red light (so it looks blue), and in the Acid form it will act like a shorter aerial absorbing short wavelength blue light so it will look red.