I recommend that you disconnect electrical power (turn off the breaker or pull the fuse) to the fan and check your electrical wiring connections first. A loose wiring connection could cause this problem.
If all of the wiring connections are secure, then the next step would be to check the voltage being supplied to the lighting section of the fan. Do not attempt to conduct this test unless you have the proper equipment (volt/ohm meter) and the technical knowledge to safely measure this live voltage.
The lights are usually connected to a black wire with a white tracer. The neutral wire is usually white. Refer to the installation instructions of your particular fan for specific wiring connections. Carefully restore power to the ceiling fan and measure the voltage supplied to the wires to the light fixture.
NOTE: Do not conduct this test unless you are completely confident that you can safely test this live voltage.
If you are able to safely verify that you have proper voltage supplied to the light portion of your ceiling fan, then you may have an internal switch or wiring failure in the fan that is preventing the lights from working. Without a brand and/or model number of the fan, I am not able to see the specific wiring of the lighting system.
If you need more specific help with this problem, resubmit your question with the brand and model number of the fan along with additional details.