Yes it's highly recommended that you replace tie rods in pairs to avoid problems and because when one tie rod goes bad the other one will soon go bad.
Also if you don't replace the tie rods in pairs it can make it difficult to get your wheels aligned properly which should be done after replacing tie rods.
When you replace the tie rods you should have the wheels aligned afterwards to make sure your front wheels are tracking properly and to avoid uneven tire wear.
I've had to replace only one tie rod before when that was all I could afford so you could replace tie rods one at a time if you can't afford to replace more than one.
But if possible you should replace tie rods in pairs.