Cognitive flexibility, the ability to adaptively change a learned behaviour in response to changed environmental contingencies is likely of high importance for individuals in rapidly fluctuating environments. To better predict how environmental changes can drive the evolution of cognitive flexibility, the aim of this thesis is to explore the genetic and epigenetic causes of individual differences in cognitive flexibility using the great tit (Parus major). I show that cognitive flexibility is repeatable but that the contribution of heritable genetic variation is low. This suggests that cognitive flexibility resembles a direct response to variation in the current and past environment. In addition, I find that this is steered by two dynamic aspects of the genome, DNA methylation and chromatin accessibility. In the future, experimental work is needed to investigate how experience-driven epigenetic changes interact with the genome to affect individual variation in cognitive flexibility.