Iíve been following the chain of comments, and I thought I would try to clarify.
Simply stated, the blue wire you found in the fan is for the light, and would be connected along with the black wires from the fan, to the black wires in the ceiling. The key here is to know how the original fan was wired. Most likely it had a black wire, a white wire, and a green wire (also used as ground), and each was connected to a corresponding wire or wires in the ceiling. The green wire may have just have been attached to the metal box in the ceiling. This green wire from the fan allows for some shock protection should the fan develop a short.
They make the fans with separate wires for the light, because not all fans have a light, and in this way a light could be added later. As an example, you could have simply gone a bought a light assembly for the old fan instead of replacing the whole fan. Additionally, some people like to mount switches for the fan on the wall instead of using the chain, and also like to have separate switches for the fan and light.
To assemble, make sure all of the unconnected black wires coming out of the ceiling are connected to all of the unconnected BLACK AND BLUE wires coming out of the fan. Then, make sure all of the unconnected white wires in the ceiling are connected to the same from the fan. Last, connect the ground wire (bare or green) from the fan to the same in the ceiling. Optionally, there may be a ground screw, painted green, which then receives both the ground wires from the ceiling and the fan. Use wire caps to hold the wires together, and cover with electrical tape. DO NOT use just tape. That can be very dangerous. . When you are done, there should be no unconnected wires coming from the ceiling. There may be an unconnected wire in the fan, of another color other than what has been discussed here, and if so you will have to figure out what it is for, and if it is needed. Also, if you have an unconnected red wire coming out of the ceiling, it will need to be investigated before you continue.
And as a cautionary, make sure the electricity is turned off at the breaker panel. Donít rely on just turning off a wall switch. And if you are unsure of anything, seek the assistance of a professional.