I went to the A.O.Smith "motor academy" class many years ago. While replacing a capacitor will sometimes solve a problem, it was taught that a bad capacitor was usually a symptom of a larger problem and replacing one is not always the best way to address it. Prices for motors for pool pumps, while not inexpensive, have not kept up with inflation and the price should not stop one from just replacing it (along with the required seals, "O" rings, etc.). If your not sure how to do it, it is best to hire a professional. Remember you are mixing high voltage, highly conductive water, and your family. You only get one chance to do it right. And, if done right, they should last at least 10 years, it is really not a bad investment.
If the capacitor is bad, then replacing it with an identical capacitor should resolve the issue, at least temporarily. If the capacitor failure was caused by something in the motor then, of course, the same thing will happen again.
Capacitors are an electrical component that can fail. It does not necessarily indicate a problem with the motor. It's usually worthwhile replacing the capacitor if the motor looks to be in relatively good condition.
Is the new capacitor the exact same specifications?