Her relationship with the Nazis is complicated, and is only relatively recently being studied and interrogated more deeply, but there are broadly two schools of thought on the matter:
or:
Allegations about Chanel's wartime activities have persisted since the 1940s, and she was interrogated by the French authorities after the war, but no action was taken — allegedly thanks to some wily manoeuvring and pulling of strings on her part.
The major (recent) source for the second claim is a 2011 book by American journalist Hal Vaughan, Sleeping with the Enemy: Coco Chanel's Secret War. The book is not without its critics, but he presents some pretty compelling evidence, including documents from the archives of both French and German intelligence services.
Chanel consistently denied that she worked for the Germans; her defenders generally claim that the fact she was given an Abwehr agent number and assigned a codename (WESTMINSTER) is inconclusive, and that many people were registered in this manner without their knowledge or any action on their part. That's Vaughan's cornerstone evidence, and I agree (to a point) that it's not ironclad — but there does seem to be a pretty strong case to be made that Chanel existed in close proximity to several German intelligence officers, and that her relationship with the occupation authorities went far deeper and was far more involved than she ever admitted.