Dynamical behaviors of recurrently connected neural networks and linearly coupled networks with discontinuous right-hand sides