Apologies for the bump, but this "do Police have to identify themselves" question comes up a lot.
For future reference for NSW, Bill once again pretty much hit the nail on the head - even though he's from another state.
The relative law for NSW is the "Law Enforcement (Powers and Responsibilities) Act 2002". The relevant part is "Part 15 Safeguards relating to powers", sections 201, 202 and 204A. In short, NSW Police are required to identify themselves when exercising certain powers, and that includes when stopping a motor vehicle.
The following is a summary of the relevant bits when it comes to traffic stops:
NSW Law Enforcement (Powers and Responsibilities) Act 2002
Part 15 Safeguards relating to powers
s201(1)(b): "a power to stop or search a vehicle, vessel or aircraft" is a power applicable to Part 15.
s202(1)(a): When Officers are not in uniform, they are required to "provide evidence" that they are a Police Officer (i.e. physically show their official ID).
s202(1)(b): When Officers are in uniform, they are only required to provide their name and place of duty (usually rank, surname and station).
s202(1)(c): Officers must provide the reason for exercising the power (i.e. the reason for stopping the vehicle).
s202(4): If two or more Officers are exercising the power, only one of them is required to identify themselves.
s202(5): If a person who is subject to the exercise of a power asks the Officer for their name and place of duty, the Officer must provide that information. (Remembering that this only applies to the powers listed in s201(1) and only to one Officer if more than one are present.)
So for the other question that is commonly asked: "can I get out of this/that if the Police don't identify themselves", the simple answer is "it depends".
s204A(1): If an Officer fails to comply with Part 15, it "does not render the exercise of the power unlawful or otherwise affect the validity of anything resulting from the exercise of that power."
Unless...
s204A(2): "Subsection (1) does not apply if the failure to comply occurs after the police officer was asked for information as to the name of the police officer or his or her place of duty (as referred to in section 202 (5))."
And...
s204A(3): "Subsection (1) does not apply to the exercise of a power that consists of a direction, requirement or request to a single person."
To sum it all up for traffic stops, at least one Officer MUST identify themselves, and the exercise of powers can only be unlawful
if you explicitly ask for the name and place of duty where the Officer has not previously provided it, and the Officer does not comply.
In the case of a "direction, requirement or request to a single person" (this does not include a traffic stop, which is listed separately in s201), failure to comply with Part 15 does not
render the exercise of the power unlawful. An example of this would be if you are loitering or acting suspiciously and an Officer gives you a direction to "move on".
Hope that answers a question that I've seen constantly repeated on several different forums.