Do you use your computer in a very dark room with your monitor's brightness set very high? That can easily cause headaches all on its own.
Another thing that is causing headaches these days is the flicker from some LED monitors.
Therefore, I believe that f.lux can help, but I feel that in this case it might be more of a band-aid type of solution.
I think that headaches might possibly also because by other things, like dehydration.