A combined experimental and theoretical study is presented of the band gap of AlInN, confirming the breakdown of the virtual crystal approximation (VCA) for the conduction and valence band edges. Composition dependent bowing parameters for these quantities are extracted. Additionally, composition dependent band offsets for GaN/AlInN systems are provided. We show that local strain and built-in fields affect the band edges significantly, leading to optical polarization switching at much lower In composition than expected from a VCA approach.