Nail clipping has obviously become a bad experience for your cat... it could be possible that you have accidentally cut too close a couple times or maybe the nail split causing some pain and making him afraid of getting his nails cut. Unfourtunately, this is bound to happen once in a while...
In order to get your cat to tollerate having his nails clipped again, you need to turn a negative experience into a positive one.
I would suggest starting by just handling your cat as if he were going to have his nails clipped. Hold him the way you would and handle his paws a little bit only for a short while, then immediately follow it with a treat and lots of pets and praise. Do this frequently until he comes to tolerate it well and associates it with the good things. Next, you can move on to clipping a nail or 2. Do only just one or 2 and then immediately follow with the treat and praise. As he becomes used to it, you can start clipping more at a time. Also, always use a good pair of sharp clippers and make sure you don't cut to close. You want to always try to make nail clipping a positive experience for him.
As for training him to use his scratching post, you want to make that a positive experience as well. If he starts scratching the carpet, don't punish, but instead direct him to his scratching post and reward him with a treat and praise. You can encourage him to use the scratching post by playing with him near it and encouraging him to jump and claw on it. You can also try rubbing it with catnip.
You may also need to get a variety of different scratchers. If your cat likes the carpet, try a scratcher that is horizontal or on an incline. Try different materials as well. Some cats prefer carpet while others like sisal or cardboard. Vertical scratching posts should be very sturdy and they should be as tall or taller than your cat is standing up with paws outstretched. If you have a big cat, that may mean that you need a scratching post that is 4' tall.
If you are a little bit handy, you can make a good scratching post by fastening a post to a sheet of plywood and wrapping the post in sisal rope or carpet, or even leaving the post bare if your cat prefers natural wood.