Erratic temp Gauge 05' Buick Rendezvous

I am not sure you have a problem. That fan is designed to turn on when it is needed. , which is when the engine gets hot. It turns off as the engine cools. Sounds to me like it is working as designed.