We consider a reaction-diffusion system with discontinuous reaction terms modeled by non-ideal relays. The system is motivated by an epigenetic population model of evolution of two-phenotype bacteria which switch phenotype in response to variations of environment. We prove the formation of patterns in the phenotype space. The mechanism responsible for pattern formation is based on memory (hysteresis) of the non-ideal relays. © 2014 Elsevier Inc.