<< It seems that manufacturers produce a bunch of identical chips and then sort them by the speed based on their tests. >>
This is exactly what happens.
<< Does anyone know what percentage of them fail? >>
This depends primarily on how big the chip is. As an explanation: imagine that you have a bunch of grains of rice and throw them on a wafer. Then imagine that the wafer is divided into big squares, say 16 total. The odds are fairly high that a grain of rice (a defect) landed in a square because the squares are very large. If you reduce the size of the squares, more of them are likely to be rice-free.
<< And if they do fail, are they thrown out or is there anyway to repair them? >>
Outside of memory (in SRAMs, DRAMS, and in microprocessor caches), it is not impossible to repair them, but it would be a tedious affair with a random defect and would certainly cost many hundreds (if not possibly thousands) of times more than simply manufacturing another. Random defects, except in memory elements, are not repaired. In certain memory structures (DRAMs and microprocessor caches), redudancy is built into the structure and is tested and fuses are blown to kill defective rows.
<< Also, why are the silicon wafers circular? It seems to make more sense to make them into a rectangular figure so less of the area is wasted. >>
This showed up in another current thread and Outersquare had a good reply, but I can't remember the title of the thread. Wafers are circular due to the method by which they are produced. For silicon chips, all of the silicon atoms need to be aligned in the same direction. So not only do you need a very pure material, but everything must line up exactly. It turns out that there's a relatively "easy" way to do this, you take a chunk of aligned silicon and use it as a 'seed', dip it into a vat of silicon at just the right temperature and pull it out very slowly. You end up with something that looks like a silicon sausage. Then you cut the ends off and slice it cleanly into very thin slices which are then wafers. No one has found a way to do this such that the wafers are rectangular and this method is so much easier than other methods that could produce square or rectangular wafers.