For what purpose are the transformers used? Can they be used with a direct current source?
The purpose of the transformer is to step-up or step-down the A.C voltage.
A transformer cannot be used for D.C because
A transformer has two coils, a primary coil, where the input voltage and current are fed, and an output coil, which turns out the processed voltage and the current, connected to the load.
These coils are made up of copper and therefore have almost zero resistance. Transformers work on the principle of electromagnetic induction, that is, as long as there's a change in the current flowing through either of the coils, an emf will be induced in the other coil. If the current becomes constant, the emf will disappear.
When you connect the primary coil to an AC supply, the current changes constantly, and you continuously get an emf in the other coil. Not exactly rocket science.
In D.C.
Initially, there's no current flowing in the primary coil, so that when you connect it to a D.C source, a current suddenly appears in it. For that infinitesimally small instant, you'll get an emf in the other coil, and once the current becomes steady, the emf will disappear. Since the coil has almost zero resistance and provided that you connect it directly to your DC supply, a very large amount of current will flow and short out the supply, melts the wires probably.
Transformers don't work with DC, because the current in a DC circuit is fairly constant.