Characterizations of the core inverse and the core partial ordering