Children inherit half of each parent's genes, which means that for any given gene you have, there is a 50% chance that any given child of yours will inherit it. Now if you have two children, then you have succeeded at breeding at replacement, and the total number of your genes in the world remains the same after you die. But of these genes, only 75% are likely to be unique, because if one of your two children has a 50% chance of inheriting a given gene, then the chance that between the two of them at least one of them will inherit it is 75%.
So even if a population manages to breed at replacement indefinitely, then they will lose 25% of their genetic diversity with each generation. And really, this attrition happens even if the number of children one has is higher; it just happens at a somewhat slower rate in that case.This makes one wonder how genetic diversity came about in the first place. I think it resulted from the high selection pressure of the past (high birth rates and death rates) combined with the diversity of environments, to result in a diversity of genes that are naturally selected to adapt to the diverse environments.
This logic isn't right for 2 reasons. First, the parents may share genes. So if one parent has AB and the other BC then average odds of a child inheriting a parent's gene is 75% not 50%, because B is 100%. The second problem is that the same genes are spread throughout the population. So if you have 2 couples - (AB,CD) and (AC,BD) - then the chance of losing genes is based on the sum of the children. Extend this to a big population, and the chance of losing common genes drops dramatically.
I have heard it said before that humans share 90% of their DNA with a banana. Those genes probably don't face the risk of attrition, since they are spread throughout the population and throughout all species. But who cares if those genes are preserved? The genes that identify you are going to be a small minority of genes which aren't so spread throughout the population.