You can generally refuse to show ID or state your name when the law enforcement encounter is clearly voluntary.