I am not a lawyer and can give you no legal advise, this is all my opinion.
http://en.wikipedia.org/wiki/Stop_and_Identify_statutes#States_with_.E2.80.9Cstop-and-identify.E2.80.9D_statutes
First it depends on what type of encounter it is: consensual, detainment(terry stop), or arrest.
To determine if the stop is consensual, ask "Am I free to go?" or "Am I being detained?" or something similar. Some LEO's will not want to answer that question. He will try to deflect you with questions of his own, but just keep asking if you are free to go. If you are free to go, you have the right to just walk away without saying another thing. If you stick around you are agreeing to the consensual encounter. You still have the right to not speak if you don't walk away, but the cop has the right to keep asking you questions.
If it is a terry stop or an arrest, according to the law, you have to give your name, address, and conduct under
§968.24. The constitutionality of requiring your address and conduct has not been addressed by the courts. But requiring your name has been addressed and it is constitutional. Personally, I would just give name and address cause I think telling them why I'm there could be giving up my 5th amendment rights.
You are not required to carry ID unless you are driving. If you are driving, you MUST produce ID when asked for it.
NEVER lie to a police officer. If you don't like the question, don't answer it. Respond with either silence, "I choose not to answer that", "I would like to consult with my lawyer", or ask him a question(basically not answering his). Answering his question with a question will piss him off.
Always keep in mind that even though it is against the law for you to lie to a LEO, it is NOT against the law for him to lie to you. Some LEO's will try to intimidate you and lie to you. Its your responsibility to know your rights.
LEO: "let me see your ID"
me: "do i have to give it to you?"
LEO: "yes, its the law"
If you are not driving, it is not the law. But he can lie to you about it.
ALSO, keep in mind that any LEO can arrest you for anything he wants too. If he doesn't like your choice of shirts he can arrest you for disorderly conduct, and take you down to the station. If he thinks its the law that you have to show ID, he can arrest you and take you to the station for not producing your ID. He can do anything he wants. Then the DA has to decide if he wants to press any charges. MANY MANY people have been thrown in jail for up to 72 hours just to have the DA drop all charges, just because the LEO didn't like someone's attitude or he didn't know the law. So choose wisely when not answering a LEO's questions or disobeying his orders.