We have a 2004 Toyota Prius that needs a new hybrid battery, and other work. Total cost is about 5k.
What would you do? Repair the car and maybe it will continue for another 10 years, or invest in a different car?
I would seek a second opinion on the battery before spending money on it. It's also very important to be sure that it is the Hybrid Battery as opposed to the standard 12V "Accessory" Battery, which is easily and cheaply replaced. This miscommunication has made for some very happy bargain Prii shoppers.
I would also consider corrosion as a major factor in getting rid of a car vs. fixing it.
If rust isn't an issue in your area, then keeping a car going, providing it is a quality safe vehicle is generally a better idea than getting another pre-owned vehicle and having to deal with possible issues.
If rust is an issue in your area, or rust is already an issue for your vehicle, it's going to be a very difficult personal choice.
It is very subjective to state whether a car is worth repair or not.
My personal opinion is that the Prius was a very well designed vehicle, and you should consider keeping it, if all other aspects of the vehicle have been well maintained and it is free of rust.
There are aftermarket Hybrid battery options which may offer better performance for less money. You'll want to check in with Prius-Specific forums to get the most current information about such.
I hope this helps.