A Southern California mayor has agreed to plead guilty to acting as an illegal agent for the Chinese government, and has resigned from her city position, officials said Monday.