So, in total, your ceiling jbox has: 1 black wire 1 white wire 1 black wire wire nutted to 1 white wire 1 ground wire which is connected to the jbox
You do not mention if the wiring itself has ground wires or if the ground only goes to the box alone.
You do not mention how these wires were connected before.
As a GENERAL RULE, black and white wires are never connected together.
Here is what I THINK is going on.
You have a HOT black cable coming from the beginning of the circuit, running through your ceiling box, jumping to the white conductor of a cable that runs down to the light switch. The white conductor carries the current down to the switch, which when closed, carries the current back to the jbox through the BLACK conductor of that same piece of wire. That black conductor terminates at the jbox and sits by itself waiting for a filament to burn or a motor to run. The other LOOSE WHITE wire is sitting in the jbox waiting to take the current back to common.
To connect your ceiling fan, you should connect the white to white, the black to black only, the green to ground, but I don't know what the blue wire is for except possibly as a control device for adjusting the speed of the fan. You would have to read the installation instructions or contact the manufacturer.
I am not a licensed electrician, I cannot test your circuits with a meter from my house, and I can't see the actual situation beyond what you have described. IF you are still confused by this, know your limitations and sleep better at night by paying an electrician to come out and take care of this for you.