We should form two cases, one of 0 (because 0 can't be the first one) and one with all numbers 1-9, to find out how many numbers there are that use a digit 3 or more times. Then, we can subtract this from 90,000 (the number of five digit numbers). This will give us the desired number.
Case 1: 0 shows up more than 3 times.
When you think about it, the only way 0 shows up more than three times is if the number is 10,000; 20,000; 30,000; etc., up to 90,000. So we just have to add nine to the following case.
Case 2: Some number 1-9 shows up more than 3 times.
This is slightly more tricky. We start with 1, just to make things easy. But when you really start to think about it, 1's would have to fill 4/5 slots in the number for it to break the rules. Therefore, the numbers (if the 5th number is 2) would be as follows:
11112
11121
11211
12111
21111
and we can do the same thing for every other number, 0 and 2-9. However, 01111 does not count, so we have to make sure to get rid of that one as well. Therefore, there are 8 times 5, or 40 ways this can be done for the number 1 for 2-9, and 4 ways this can be done with 0. Overall, the number 1 can be made in 44 different ways. This is also true for 2, 3, 4, 5, 6, 7, 8, and 9 (try plugging them in above where 1 is now). This gives us 9*44 + 9 ways to break the rules, or 9*45 ways. This comes out to 405 ways.
Subtract this from 90,000 and you will see that there are 89,595 ways to accomplish your task.
There are 3 cases:
1. 3 digits identical: $aaabc$
There are $4+3+2+1$ ways of arranging $b$ and $c$ such that $b$ always comes before $c$. Then there are $6$ choices for $b$, $5$ for $c$ and $4$ for $a$. Thus there are $10\cdot6\cdot5\cdot4=1200$ numbers.
For $aaabb$, we have $10$ ways of arrangement and therefore a total of $10\cdot6\cdot5=300$ numbers.
2. 4 digits are identical: $aaaab$
There are $5$ positions for $b$. So there $5\cdot6\cdot5=150$ numbers.
3. 5 digits are identical: $aaaaa$
There are clearly $6$ such numbers.
So there are $\boxed{1656}$ such numbers.
To count the ones with $2$ identical digits, we have $2$ cases.
1. $aabcd$
There are ${5\choose 2}$ ways of placing the $a$'s. We will not arrange $bcd$ since it will cause over counting. So we have $10\cdot6\cdot5\cdot4\cdot3=3600$ such numbers.
2. $aabbc$
There are $5$ ways for placing the $c$. For the remaining $4$ positions we have $4\choose 2$ ways of placing the $a$'s and $1$ way of placing the $b$'s. So there are $5\cdot 6$ ways of arranging. But we divide this by $2$ since $a$ and $b$ are interchangeable. So we have $15$ ways of arranging these. Thus there are $15\cdot6\cdot5\cdot4=1800$ numbers.
So there are $5400$ numbers with $2$ digits identical.
Best Answer
First approach: Pick which three spots host the identical digits; there are $\binom53$ ways to do this. Fill those three spots in one of $9$ ways, and then fill the other two spots in any of $9$ ways. Thus, $\binom53\times 9^3$
Problem with this approach: the number $12222$ has been counted $4$ times, once as $1\color{red}{222}2$, once as $1\color{red}{22}2\color{red}{2}$, once as $1\color{red}{2}2\color{red}{22}$, and once as $12\color{red}{222}$. Similarly, a number such as $44444$ has been overcounted by a factor of $\binom53$.
This can be fixed by subtracting out the repetitions. There are $5\times 9\times 8$ numbers with exactly $4$ digits identical, and $9$ numbers with exactly $5$ digits identical.
Thus: $\binom53\times 9^3 - (5\times 9\times 8)\times(4-1) - 9\times\left(\binom53 - 1\right)$
This comes out to $7290 - 1080 - 81 = 6129$
Doublecheck: Count the numbers with exactly $3$ identical digits, then the ones with exactly $4$, then the ones with exactly $5$:
$\binom53\times 9\times 8\times 8 + \binom54\times 9\times 8 + 9$
which comes out to: $5760 + 360 + 9 = 6129$