Overheating only with AC on and while idling? Could be fan, but I believe it could also be therm or the temp sensor on lower hose. There are a number of 'feeds' to tell therm to open. If yours was an aluminum housing therm, that makes it suspect.
I know the fan should come on for a few seconds when you turn on the AC, just so the car knows it works, but usually it will be off. I don't otherwise know how to test it.
You'd might have some codes stored that would help you diagnose this...find a local with code reader.
I'm so depressed. No one wants to come see me in NYC: Sat, Oct. 8, 6 p.m. at Greenwich Village Comedy Club.
Mangofy your E46!