Hey Jay,To find out if it is indeed rust take a magnet and place it on the pipe If it sticks it is ferrous metal and YES it could be rusting out. If it doesn’t stick it is non ferrous metal and it doesn’t rust.
The piping if corroded/rusted or suffering signs of erosion should be replaced.
You asking how much to be replaced is IMPOSSIBLE to answer as
1- What diameter piping do you have?
2- How long is the run from the water source
3- What material is your new water main going to be (I use “K” copper strictly for water mains) Unless local soil conditions dictate differently
4- Is the water main tap you do have now adequate for the fixture unit demand you have in the building
5- Will you have to install a water meter and or a back flow preventer or a PRV when you upgrade your main
Call a Local Master Plumber to take a look and the price he/she charges to investigate maybe the best money you ever spent