A faulty switch or poorly wired lamp is at the least irritating, at the most dangerous. But you don’t have to get rid of a nice old lamp just because it’s not working.
You shouldn’t have to dismantle the whole lamp, but just in case, the diagram below shows how a lamp goes together.
Buy the appropriate socket assembly (push-through, tri-light, etc.) and a good quality copper strand lamp cord with plug. Unplug the lamp, then lift the insulated sleeve and shell off the socket assembly (you might need to pry it off with a small screwdriver.) After unscrewing the terminals inside, you can probably pull the cord right out, without removing the old socket base. If your new socket and shell fit the old base, simply run the new cord through from the bottom.
To remove the old base, unscrew the setscrew, and turn the base counter clockwise to remove it from the lamp pipe. Screw on the new base and tighten the setscrew.
To connect the wires to the terminals, first tie an “underwriter’s knot”. Loop the wires in opposite directions before inserting each wire end through the other’s loop. Twist the copper strands one twist, then wrap clockwise around the screws: the ribbed cord on the silver screw, and the smooth cord on the gold screw. Tighten the screws.
Press on the socket shell and you’re done.