If both wires are black then the one with the writing is the neutral wire. If the two wires are black and white then the white one is the neutral.
If both wires are black, the one that connects to your white wire is the one that should have little writing on it. Black to the plain black wire, white to the wire with writing.
If you are adding the pull chain to an existing fixture then the pull chain switch should have two wires. Wire nut either one to the hot wire coming in and the other to the black wire of the fixture.
Connect the ground wire to the metal box.
The pre wire for a ceiling fan light should be made with a three wire cable. This cable will have a red, black, and white wire as main conductors. This cable will also have a bare ground wire. This wire should be strung between a two gang switch box to the fixture junction box. This pre wire allows the supply to be either fed to the two gang box. From the two gang switch junction box, one side will be used for the light in the fixture and the other side of the switch junction box, itwill be used for the fan portionin the fixture.
Based on your description it is very likely that either the red wire or black wire is switched and the other is on all the time. In most cases the light of the fan, if it has a light, is connected to the switched wire and the fan is connected to the unswitched wire. This allows you to turn off the light while allowing the fan to remain running. There is no way to know without testing which wire is switched. The white wire is the neutral, connected to the white, or neutral, or common conductor of the fixture. There should also be a bare or green wire in the box to connect to the ground wire of the fixture.
The green wire on the light fixture is a ground wire. If there is no ground wire in the conduit, the green wire should be attached to the metal box with a screw.
If both wires are black, the one that connects to your white wire is the one that should have little writing on it. Black to the plain black wire, white to the wire with writing.
If the question is, can I wire a switch to an existing light fixture (and I must assume that it's something like a pull-chain light fixture), the answer is yes.If the question is, "how do I wire a switch to an existing light fixture that has no external switch", the answer is, "in series".The attached web site gives simple instructions on how to wire a basic light switch to an existing light.See sources and related links below
The fixture box should have a ground screw on the bottom of the box. Sometimes you have to move other wires out of the way to see it. Just reconnect the fixture ground wire to this screw.
The light is wired the same as any voltage fixture. Bring the source voltage to the fixture and connect it to the two fixture wires. If you want to control the off-on of the fixture take the source voltage to a switch first and then out of the switch to the light fixture.
To the black wire on the fixture.
Piggyback off the box for the existing light. Run a wire from the existing junction box to a new junction box (which is placed wherever you want the new fixture). Then, in the existing box, connect the wire coming from the switch, the wire for the existing fixture, and the wire for the new fixture together using wire nuts. Wire up the new fixture, and presto, you have two fixtures on a switch where there was only one before.
If you are adding the pull chain to an existing fixture then the pull chain switch should have two wires. Wire nut either one to the hot wire coming in and the other to the black wire of the fixture.
Is this a fluorescent fixture? Most fluorescents will not start if the fixture is not grounded. Make sure the fixture has the branch circuit ground wire properly connected.
Connect the ground wire to the metal box.
The pre wire for a ceiling fan light should be made with a three wire cable. This cable will have a red, black, and white wire as main conductors. This cable will also have a bare ground wire. This wire should be strung between a two gang switch box to the fixture junction box. This pre wire allows the supply to be either fed to the two gang box. From the two gang switch junction box, one side will be used for the light in the fixture and the other side of the switch junction box, itwill be used for the fan portionin the fixture.
By earth wire I am assuming you mean the bare wire and that a black and white wire are connected to the light. If when you connect the earth wire and breaker trips then there is a short between black and earth. It could be a bad ground connection, an internal short in the light fixture where black wire "hot" is connected to metal on the fixture through a nick in wire.