The white wire is wrapped with black tape to identify it as hot. The black wire connects the fan to the speed controller. The red wire connects the light to the dimmer.
This diagram illustrates the wiring for a circuit with gfci receptacles followed by an unprotected light and switch. The light switch is connected directly to the source and the load terminals on the gfci are not used.
To wire a 3-way switch circuit that controls both the fan and the light, use this diagram. As with all 3-way circuits, the common on one switch is connected to the hot source wire from the circuit. The common on the second 3-way switch is connected to the hot wires on the fan/light.
This diagram illustrates the wiring for a circuit with gfci receptacles followed by a light and switch. By connecting the switch to the load terminals on the gfci, the light is protected against ground faults as well.