sorry. I tried to write a more complete post using TeX... but the forums are not letting me post it.
So... briefly:
<a|b> is an inner product in Dirac's notation. A number.
|a><b| is an "outer product". This is an operator (called a "dyadic"). It acts on states. For example,
the action on a state |c> is to produce a ket proportional to |a>, namely |a><b|c>.
To prove the expression for a complete set write an arbitraty ket |psi> in terms of a sum over the complete set {|r>}. The coefficient of each term in the sum can be rewritten in terms of the inner product of |psi> with |r>. Rearranging and noting that psi is arbitrary gives I=sum_r |r><r|