Activating iMessage (and FaceTime) requires registrering a mobile phone number with Apple to link it to an Apple ID. The set up procedure of a new or emptied phone on factory settings, should guide you through the procedure. Usually this includes receiving an SMS text message from Apple.
If you get an error when trying to activate iMessage or FaceTime - Apple Support