A minor has most of the same Fourth Amendment protections as an adult, especially where the police are involved. That means you can walk away unless the officer tells you that you are not free to leave, which he can do with a valid detention--he does not have to arrest you. California has no law requiring you to provide a police officer with ID unless you are doing something that requires one, like driving a car. But if you do not identify yourself and an officer has cause to believe you committed an offense, you might be taken into custody rather than simply cited.
However, although some people enjoy getting in the face of police officers, the better course is to be polite and cooperative, though not to the extent of allowing them to do things they would not otherwise be permitted to do. For example, my advise is never to consent to a search of your person or effects (though that does not mean that an officer cannot search you with proper cause for doing so).
35+ years as a criminal defense attorney