In general, you do not have to talk to law enforcement officers (or anyone else), even if you do not feel free to walk away from the officer, you are arrested, or you are in jail. You cannot be punished for refusing to answer a question. It is a good idea to talk to a lawyer before agreeing to answer questions.