The frayed fins are an indication of a disease called Fin Rot which is a bacterial ailment.
The black patches are as a direct result of exposure to harmful ammonia in the water. Ammonia is caused by fish waste and decaying matter and is broken down rather quickly in an established aquarium. If your tank has been up and running for more than 6 weeks and has not had a major water change then ammonia should not be present.
What I recommend be done is start off by changing 35% of the water in the tank making sure to use dechlorinated water that is the same temperature as the water currently in the tank.
After the partial water change add some aquarium salt at a ratio of 1 tablespoon per every 2.5 gallons of water.
Then begin to treat with a medicine called Maracyn Two, click on link below for a view of the product. It's easily found at pet stores. Just follow the directions on the product label for usage instructions.
I would also suggest that you begin to monitor the water parameters for levels of ammonia and nitrites. Both are harmful and often lethal to fish. You can test the water yourself using a standard test kit or bring a water sample to your local pet store where they will usually test for free.
If ammonia and nitrites are present in any amount you should begin to do daily 15% partial water changes until they are completely eliminated.
Keep in mind that no medicine will work if ammonia and/or nitrites are present in the water.
Good luck and please let me know if you have any questions.
Stress Coat is perfect to use as it supplies the fish with the healing ingredient aloe vera and more importantly removes chlorine and chloramine from tap water. Just make sure the proper dose is added which would correspond to the amount of water being added.
You've mentioned something extremely important="the tank has only been up and running for 3 weeks". As the tank is a new set up the water is passing through something called the cycling process which would explain the presence of ammonia in the water thus the black markings on the fish.
Listed below are 3 links that will explain cycling, I strongly suggest you thoroughly read them and then read my recommendations below.
This situation is a little unique so what I'm about to write below would apply to having healthy fish in the tank and the sick fish seperated. I'll recommend a treatment plan for the sick fish once I've covered the guidlines for cycling
In order to get through this most difficult period in the life of a new aquarium and save the fish certain steps should be taken to minimize the impact. They are:
1) Drastically cut down on the amount of food being fed as the excess fish waste produced by overfeeding is fuel for ammonia and nitrite growth. Feed the fish a pinch of food once every other day.
2) During the cycling process do not change or clean the filter nor the filter media as this is where the beneficial bacteria will grow.
3) Do not add any fish to the tank during the cycling process, even if one dies. The only time you would add a fish is if all the current inhabitants die.
4) I know it's a temptation but it would be best to not administer any products that eliminate ammonia and nitrites as these products are only a temporary fix and will delay the cycling process.
5) Test the water every 3-4 days and when either ammonia and/or nitrites begin to rise immediately do a 20% partial water change. Water samples can be brought to your local pet store for testing or you can test on your own using a standard test kit(s).
6) Add some aquarium salt to the water at a ratio of 1 tablespoon per every 5 gallons of water. When doing a partial water change add only the corresponding amount of salt to the water being added. The aquarium salt will help fthe fish cope with the nitrites.
7) Keep the water temperature in a range of 62f-72f degrees as this is the preferred range for goldfish. Also , water holds more oxygen at lower temperatures.
8) (You didn's speak of ph but just to make sure)--Do not attempt to adjust the ph at this time as changing the ph will further complicate matters.
Re: the sick fish:
Keep the fish isolated in a seperate smaller tank. It's important to not let harmful ammonia form or else all treatment attempts will be in vain so changing all or 75% of the water every other day will be necessary in addition to minimal feedings (once a day).
Once this fish recovers you can place it in the main (cycling) tank but keep in mind that it might again succumb to disease if it does not handle the cycle well. I would keep an eye on the fish until the tank cycles which usually takes 6-8 weeks.
If there are currently no other fish in the main tank I recommend you place some in there as without fish a tank cannot cycle. I would suggest putting only 1 goldfish in the main (cycling) tank.
Best wishes and please let me know if you have any questions and please do try and read the links listed below.