Why does ex say to stay in contact and be friends if he.she was the one to breakup?

Maybe because he/she just thought it wasnt working out and you would be better of as friends.