If you have the ability and time you can do it yourself for a lot less. I replaced my back fence for the cost of the wood from Home Depot which was only a few hundred. Took me about three days. Studied the design of neighborhood fences I liked and then did the same in building mine. My posts were in great shape and I didn't have to replace a one so that made a huge difference.
New cedar pickets will dry out and shrink so I nailed them tight to each other. I didn't do that to part of the fence I replaced earlier and there were bigger gaps that you could see through. Used a string to keep them even at the top.
It's been about a year and a half and the fence looks great.
Actually, I paid my out of work nephew to do most of mine.
He did an excellent job after I explained the basics, but he's got a job now.
I've replaced small sections and the gates myself without any trouble. But for big jobs you do need to be able to focus on it and spend some time. The fence folks charge quite a bit, but they usually do an excellent job.
I used to put up fences in high school. It isn;t that hard.
The prior post is right - just run a top string to keep the pickets aligned, and use a level on the side to keep them straight.
If the posts are badly rotted but the cement still good, you can dig the rotted wood out of the cement and just sledge-hammer a new post into the old cement.
YOu can also buy a string level for about $3.00. It's basically a small level that loops onto the string, if you are concerned about making sure the pickets are flush AND level.
I second the idea of checking the posts.
I saw some guy with a sign for $10 a foot in the neighborhood the other day, I will try to find the sign again.
ALSO- if you are going to do it yourself try to find out when the next "bulk trash pickup" is in your area. That way you can just haul the old stuff to the street and the City will pick it up for you!
Easy enough to do yourself, if you have the time, and inclination. I pay my fence contractor $9.50/ ft., and $75 per gate. I have referred him to others, and he charges them the same, but, if he bids to the grneral public, it will range anywhere from $12-$16/ft.