Black locust is a heavy, hard wood that is very rot resistant. Although it is somewhat difficult to work with when creating fine furniture, fence posts do not require the same level of finish. Black locust should be your first choice in terms of quality, but may be problematic in terms of price and availability.
Cedar is a very commonly used wood for fence posts. Although it is not hard and heavy like black locust and is in fact a softwood, it has a natural chemical in it that is similar to commercial wood preservatives, although not harmful in the same way that they are. Cedar is plentiful in many parts of North America. If you have a property with many small cedars growing on it, you can save a lot of money by simply using cedar cut from your land rather than buying lumber.
Redwood is known for its rot resistant properties, which is why it has been used extensively as house siding. Redwood grows only on the West Coast, which makes it somewhat impractical for other locations due to shipping. If you buy redwood, be sure that it has not been irresponsibly logged out of endangered growth areas.
Bald cypress grows mostly in the southeast. If you can get your hands on some old-growth bald cypress, you've got some seriously rot resistant wood on your hands. Unfortunately this is hard to get and more recent growth is not as rot resistant.
Spruce works fine for fence posts. Although it will not last as long as naturally rot-resistant woods such as black locust or cedar, it is significantly less expensive and easier to find.
White oak would make superior fence posts, although it wouldn't make a lot of sense to use it for this purpose due to its desirability for more refined uses such as interior trim and furniture. White oak is a very hard wood and would last for ages, but its high cost would make it prohibitive for fence posts.
The old timers in the Northeast say that Tamarack lasts "two years longer than stone." If you can find tamarack growing naturally on your land, 6 to 8 inch diameter lengths cut from middle aged trees would produce superior fence posts.