Direction current in DC motor do not change but is AC motor direction of current changes.
Fan has motor is which magnets remains stationary and when current passes through the coil, coil experiences the force due to the permanent and moves continuously.
In generator(AC motor) we use split rings, if direction of current do not change , so north pole will attract towards the south pole.
That is why direction of current changes in generator.