The power (from the breaker) is likely at the light fixture. When you hook black to black and white to white, the light is powered directly from the breaker. In this configuration, when you flip the switch on
you create a short through the switch.
![enter image description here](https://i.stack.imgur.com/jT3uR.png)
What you need to do is hook it up like this.
![enter image description here](https://i.stack.imgur.com/nIJ8Y.png)
Notice the white wire that runs between the switch and the light has a black stripe on it (in above image), that lets anybody that works on this light in the future know that the wire is switched. You can mark the wire using a bit of electrical tape, or a marker.
Figuring out which wires come from the breaker, and which go to the switch will require some tools. First Turn off the breaker, and verify the power is off using a non-contact voltage tester. Now pick one set of wires to work with first (one black and one white from the same cable). Turn the switch to the on
position, and use a multimeter to check continuity between the two wires. If the wires are connected (low resistance), these are the switched wires. If not (infinite resistance), check the other set of wires. If neither pair pass the test, contact an electrician.
If at any time you don't feel comfortable doing this work, or you don't have the proper tools to complete the task. Contact a local licensed electrician.
TL;DR: Whoever installed your ceiling fan had some terminal screws loose
The good news is that the green wire is unmistakably tagged as an equipment grounding conductor, and was likely not the current return path in the original wiring configuration. The bad news is that whoever originally wired this did a hack job, deciding to use some blue wire they had left over from the last hack job as a neutral wire (grounded conductor), which grossly violates NEC 200.6(A):
200.6 Means of Identifying Grounded Conductors.
(A) Sizes 6 AWG or Smaller. An insulated grounded conductor of 6 AWG or
smaller shall be identified by one of the following means:
(1) A continuous white outer finish.
(2) A continuous gray outer finish.
(3) Three continuous white or gray stripes along the conductor's entire length
on other than green insulation.
Now that that facepalm moment is out of the way, it's possible to fix this by nutting the blue and black conductors from the fan to the black wire from the ceiling, and the white wire from the fan to the blue wire from the ceiling. While you're up there, please, please, please tag the blue wire from the ceiling with a piece of white electrical tape -- there's no way to bring the current situation fully up to Code without ripping out the offending neutral wire and replacing it with a white or grey wire, but a tag will at least keep the next electrician's eyeballs from frying when he or she stares at your ceiling fan's wiring.
Best Answer
It's a push-in wire connector, like these from Ideal.
The wire should come out without too much difficulty; grip the connector firmly in one hand, then pull the wire with the other.
The instructions for the Ideal connectors that I linked to say:
Since you're installing a new light fixture, this is also relevant: