Where are you trying to enter the Apple ID and password ***** the iPhone?
Ok, so you are trying to use it in the iTunes or App Store?
From a computer, test out that it is working properly by signing into the Apple ID management site:
https://appleid.apple.com/ (Click "Manage Your Apple ID")
Are you able to sign in?