If the car does not overheat while idling in traffic, it cannot possibly be the fan motor, so that's a bad piece of advice. Whoever replaced your temperature gauge should give you your money back as well.
The causes for overheating can be complex. Since you overheat going uphill, when the engine works the hardest, and never overheats in traffic, then you do not have an AIR circulation issue, but rather a COOLANT circulation problem.
This could be (just a few of many possibilities):
bad (clogged radiator)
insufficient coolant level/air trapped in coolant
bad head gasket
cracked cylinder head
defective water pump
slipping accessory belt (that drives water pump)
collapsing radiator hoses at high speed (old, soft hoses).