Aims: Density waves are often considered as the triggering mechanism of star formation in spiral galaxies. Our aim is to study relations between different star formation tracers (stellar UV and near-IR radiation and emission from HI, CO and cold dust) in the spiral arms of M31, to calculate stability conditions in the galaxy disc and to draw conclusions about possible star formation triggering mechanisms. Methods: We select fourteen spiral arm segments from the de-projected data maps and compare emission distributions along the cross sections of the segments in different datasets to each other, in order to detect spatial offsets between young stellar populations and the star forming medium. By using the disc stability condition as a function of perturbation wavelength and distance from the galaxy centre we calculate the effective disc stability parameters and the least stable wavelengths at different distances. For this we utilise a mass distribution model of M31 with four disc components (old and young stellar discs, cold and warm gaseous discs) embedded within the external potential of the bulge, the stellar halo and the dark matter halo. Each component is considered to have a realistic finite thickness. Results: No systematic offsets between the observed UV and CO/far-IR emission across the spiral segments are detected. The calculated effective stability parameter has a minimal value Q_{eff} ~ 1.8 at galactocentric distances 12 - 13 kpc. The least stable wavelengths are rather long, with the minimal values starting from ~ 3 kpc at distances R > 11 kpc. Conclusions: The classical density wave theory is not a realistic explanation for the spiral structure of M31. Instead, external causes should be considered, e.g. interactions with massive gas clouds or dwarf companions of M31.