From a general definition of nonlinear expectations, viewed as operators preserving monotonicity and constants, we derive, under rather general assumptions, the notions of conditional nonlinear expectation and nonlinear martingale. We prove that any such nonlinear martingale can be represented as the solution of a backward stochastic equation, and in particular admits continuous paths. In other words, it is a g-martingale.