I was trying to install a ceiling fan in my apartment and came across these connectors when removing the light. What is this and how do I take it off?
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: