Using the symmetry theory we analyze of the flexomagnetic effect in all 90 magnetic classes and showed that 69 of them are flexomagnetic. Then we explore how the symmetry breaking, inevitably present in the vicinity of the surface, changes the local symmetry and thus the form of the flexomagnetic tensors. All possible surface magnetic classes (in the number of 19) were obtained from the 90 bulk magnetic classes for the surface cuts 001, 010 and 100 types. It appeared that all 90 bulk magnetic classes become flexomagnetic, piezomagnetic and piezoelectric in the vicinity of surface. Using the free energy approach, we show that the flexomagnetic effect leads to a new type of flexo-magnetoelectric (FME) coupling in nanosized and bulk materials, in all spatial regions, where the polarization and (anti)magnetization vectors are spatially inhomogeneous due to external or internal forces. The linear FME coupling, proportional to the product of the gradients of (anti)magnetization and polarization, flexoelectric and flexomagnetic tensors, is significant in nanosized ferroelectrics-(anti)ferromagnetics, where gradients of the polarization and magnetization obligatory exist. The spontaneous FME coupling induced by the spatial confinement give rise to the size-dependent linear magnetoelectric coupling in nanosized ferroelectrics-(anti)ferromagnetics. We show that the flexomagnetic effect may lead to improper ferroelectricity in bulk (anti)ferromagnetics via the linear and nonlinear FME coupling. Inhomogeneous spontaneous polarization is induced by the (anti)magnetization gradient, which exists in all spatial regions, where polarization varies and (anti)magnetization vector changes its direction. The gradient can be induced by the surface influence as well as by external strain via e.g. the sample bending.