It's probably the lighting control module , but without doing some electrical testing that is just a guess !
Battery positive voltage (B+) is applied at all times to the lamp control module (LCM) through the underhood junction block HDLP MaxiFuse® and CKT 1242 (RED).
When you place the headlamp switch in the HEAD position, the headlamps input to the LCM is grounded. The LCM then applies battery positive voltage (B+) through the underhood junction block HDLOBML fuse and HDLOBMR fuse, which feed the left low beam headlamp and the right low beam headlamp respectively. When you activate the headlamp dimmer switch by pulling on the multifunction lever until the switch clicks, CKT 524 (PPL) is grounded to the LCM. The LCM then removes battery positive voltage (B+) from the low beam headlamps and supplies battery positive voltage (B+) through the underhood junction block HDHIBML fuse and HDHIBMR fuse, which feed the left high beam headlamp and the right high beam headlamp respectively.
Twilight Sentinel Circuit Description
Twilight sentinel determines whether the daytime running lamps (DRL), or the exterior lamps and the low beam headlamps at full intensity should be on based upon the signal of the ambient light sensor. When the ambient light sensor detects daytime, the twilight sentinel turns on the DRL. When the ambient light sensor detects darkness, the twilight sentinel turns on the exterior lamps and the low beam headlamps at full intensity. The twilight sentinel also keeps the lamps on for a delay period of 3 to 180 seconds under the following conditions:
• The vehicle is in PARK.
• The ambient light sensor detects darkness.
• The ignition switch is turned to the OFF position.
You may turn off the twilight sentinel manually. When it is dark and the gear selector is in PARK, pushing the twilight sentinel switch to OFF will turn off the headlamps and exterior lamps. Pushing the twilight sentinel switch to OFF again will turn on the headlamps and the exterior lamps. If the gear selector is not in PARK, pushing the twilight sentinel switch will have no effect.
The F- switch is just an input from the LCM - lamp control module .
Do you know how to test control module inputs an outputs ? Very easy to fry a module if you don't know how to do it .
Also have a full scan of all modules on the vehicle , could have DTC'S - diagnostic trouble codes stored . Not for the OBD 2 engine computer . The instrument cluster , BCM , LCM can all set codes too, related to lighting an someother thing's .
ECM Inputs and Outputs Diagnosis
Electric Testing Techniques You Need to Know
You can find free wiring diagrams here http://www.bbbind.com/free_tsb.html
Enter vehicle info. year , make , model and engine ! Under system click on lighting ,then under subsystem click headlamps . Click the search button then the blue link . The first diagram you will see at the top the power supply to the LCM , down a little you will see the headlamp switch , ambient light sensor . Now if you want to start replacing thing's without testing good luck !