Depends on what the shelf's made of.
MDF is very bendy unless its really thick. Needs a bracket at least every 3
feet. I usually just guess the number of backets depending on the
material/weight/length. You want each bracket to support an equal amount of
shelf so for 2 brackets space them at 1/4 and 3/4. For 4, at 1/8, 3/8, 5/8,