The short answer, as ninjin said, is to use moisture. Try toweling your hair "dry" after a shower and brushing it immediately afterwards. You'll find that the towel won't remove all moisture and this is a good time to brush. Then let it dry as you've brushed it before going out. If you want advanced mode, get a blow dryer or straightening iron.
Length can be a factor as well. For certain weights of hair, there are some lengths that are long enough to need brushing, but not long enough that the weight of the hair is enough to keep it in place. In cases like that, growing it out longer can help. But if you have naturally very curly hair, that might not help, and cutting it shorter might. Or, if your hair is suitably long, you can use a hairtie to put it in a ponytail and tuck that into the back of your shirt and let it dry there. once it does, you can remove it from your shirt and it will be relatively straight and flat.
Picture of your hair might help.
Be aware of external factors. Are you brushing your hair, but then driving around with your windows down so that your hair is a mess by the time you arrive anywhere? Do you drive a motorcycle and have helmet-hair?
Also...to be perfectly blunt, from the OP, it's difficult to determine if:
a) Your hair is perfectly ok, and the person harassing you just likes to complain and won't be happy regardless of what you do
b) You happen to be genetically inclined towards unmanageable hair. This is actually a real problem some people have and if you check the hair care aisle of your local grocery store you'll find products that cater to people with these problems.
c) You somehow never learned to brush your hair and somehow never noticed until now.