Unless you've been accused of a crime then you don't have to show the police officer your ID.
But if you didn't commit a crime or don't have any warrants etc then it's best to let the officer check your ID and if you've done nothing wrong then you'll be sent on your way without problems.
Even though I don't have to display and ID to officers when they ask for it I do so anyway so as to get on my way without any trouble or any more of my time being taken up.