Several studies suggest that classification of piglets early in life based on the degree of resistance they display in a so-called Backtest may be indicative of their coping style at a later age. In the present study behavioural flexibility was investigated in pigs diverging for Backtest response and housing environment during rearing. Pigs were housed either without a rooting substrate (barren housing, B) or in identical pens enriched with deep straw bedding (enriched housing, E) from birth. During the suckling period piglets were subjected to the Backtest. Each piglet was restrained on its back for 1min and the resistance (i.e. number of escape attempts) was scored. Pigs classified as ‘high-resisting’ (HR) or as ‘low-resisting’ (LR) were subjected to a simple (left/right) spatial discrimination (T-maze) task at 8 weeks of age. The effect of a single, subtle intramaze change was determined after acquisition of the task. In addition, pigs were subjected to reversal learning to assess their ability to modulate established behaviour patterns. Housing and its interaction with Backtest classification influenced the behavioural response to the intramaze change: E pigs were considerably more distracted than B pigs. Housing condition affected LR pigs more than HR pigs, as indicated by the interaction effects on various recorded behaviours. These interactions indicate that behavioural responding of pigs with diverging coping characteristics cannot simply be generalised across rearing conditions. Furthermore, HR pigs were less successful in reversal learning than LR pigs, suggesting that they have a higher propensity to develop inflexible behavioural routines.