Sexing is an important part of the growing of marijuana. It is the source of much needless worry for beginning growers. You want to sex your plants to remove males. Male plants have low potency. Those interested in the psychoactive effects will want to cultivate the females for their flowers. In the 1960s people used the leaves, stems, and fertilized flowers effectively medicinally with excellent results. The leaves or "shake" can be smoked with good results. The flowers are the most potent especially when not allowed to be fertilized..
A virginal female plant will direct the bulk of its energy later in its growth phase into developing the flower buds and swelling them with the resin that carries the bulk of marijuana's potency. The plant does this so that the large sticky flowers are more likely to catch pollen. If the flower is pollinated it will instead direct the bulk of its energy to seed production. This is where low quality dirt weed comes from. If you have seedy pot, it is dirt weed. The more seeds contained in the pot the lower the quality. And of course seeds add dramatically to the weight since they weigh more than the bud itself, this is sharply contrasted with stems that are mostly water weight and have a negligible weight compared to the bud.
Plants generally should demonstrate their sex one to two weeks into flowering. During the first ten days of flowering there is very little need for concern about males pollinating your crop. Additionally, if you reproduce by cloning you will only have to worry about males once.
Identifying the Male 
Males can be identified by looking at the nodes where leaf and branch stems connect with the main stalk. Male flowers will contain balls somewhere between the size of a marijuana seed and a popcorn seed. One ball is not definitive since female pistils sometimes split from a small single ball that opens. But two or three balls in a cluster is sure confirmation that you have a male. Males should be removed and destroyed to prevent them from releasing pollen. The pollen transports easily so the males can not be safely grown anywhere that shares an A/C or ventilation system unless special precautions are taken. The males for the most part show their sex before the females. They appear often to be a lanky less bushy plant than the female. It takes about a week after showing their sex before pollen is released, making it easy to separate from the female. Males can be used to make hashish, though it will require a larger amount of leaves to make hashish or canna-butter (cannabis butter).
Identifying the Female 
Females are very simple to identify. They sprout white hairs. A small ball will form and split and two tiny white hairs like translucent threads will split out. These hairs are called pistils and intended to catch pollen. Later when the plant is not pollinated these hairs will change color.
Pistils may guarantee that your plant is not a male but your plant could still be a hermaphrodite. You must watch plants grown from seed carefully for male flowers and even a trusted clone if it has undergone stress such as light during its dark period, lack of watering, or being left to flower far past maturity.
On certain strains what are known as pre-flowers may appear while the plant is still in vegetative growth. This is perfectly normal.
Cloning for Sex 
No this is not the title of futuristic fantasy movie. You can always revert a mother to veg in order to take cuttings and can even take cuttings during flowering (although success rates will be lower and rooting will take longer) but this process induces stress on the plant that can and does cause hormonal and genetic changes. It is much better to have a mother plant that has never been flowering.
Recognizing this, people have begun taking clones from their vegetating plants when they reach maturity. Once the clone is rooted, you would either flower the original plant or the clone and keep the other under 18hr or 24hr light indefinitely.