Gynoecium
Gynoecium: is most commonly used as a collective term for the parts of a flower that produce ovules and ultimately develop into the fruit and seeds. The gynoecium is the innermost whorl of a flower; it consists of (one or more) pistils and is typically surrounded by the pollen-producing reproductive organs, the stamens, collectively called the androecium. The gynoecium is often referred to as the "female" portion of the flower, although rather than directly producing female gametes (i.e. egg cells), the gynoecium produces megaspores, each of which develops into a female gametophyte which then produces egg cells.
The term gynoecium is also used by botanists to refer to a cluster of archegonia and any associated modified leaves or stems present on a gametophyte shoot in mosses, liverworts, and hornworts. The corresponding terms for the male parts of those plants are clusters of antheridia within the androecium. Flowers that bear a gynoecium but no stamens are called pistillate or carpellate. Flowers lacking a gynoecium are called staminate.
The gynoecium is often referred to as female because it gives rise to female (egg-producing) gametophytes; however, strictly speaking sporophytes do not have a sex, only gametophytes do. Gynoecium development and arrangement is important in systematic research and identification of angiosperms, but can be the most challenging of the floral parts to interpret.
Carpels:
The pistils of a flower are considered to be composed of one or more carpels. A carpel is the female reproductive part of the flower—usually composed of the style, and stigma (sometimes having its individual ovary, and sometimes connecting to a shared basal ovary) —and usually interpreted as modified leaves that bear structures called ovules, inside which egg cells ultimately form. A pistil may consist of one carpel (with its ovary, style and stigma); or it may comprise several carpels joined together to form a single ovary, the whole unit called a pistil. The gynoecium may present as one or more uni-carpellate pistils or as one multi-carpellate pistil. (The number of carpels is denoted by terms such as tricarpellate (three carpels).)
Carpels are thought to be phylogenetically derived from ovule-bearing leaves or leaf homologues (megasporophylls), which evolved to form a closed structure containing the ovules. This structure is typically rolled and fused along the margin.
Although many flowers satisfy the above definition of a carpel, there are also flowers that do not have carpels because in these flowers the ovule(s), although enclosed, are borne directly on the shoot apex. Different remedies have been suggested for this problem. An easy remedy that applies to most cases is to redefine the carpel as an appendage that encloses ovule(s) and may or may not bear them.

The ovule:
In flowering plants, the ovule (from Latin ovulum meaning small egg) is a complex structure born inside ovaries. The ovule initially consists of a stalked, integumented megasporangium (also called the nucellus). Typically, one cell in the megasporangium undergoes meiosis resulting in one to four megaspores. These develop into a megagametophyte (often called the embryo sac) within the ovule. The megagametophyte typically develops a small number of cells, including two special cells, an egg cell and a binucleate central cell, which are the gametes involved in double fertilization. The central cell, once fertilized by a sperm cell from the pollen becomes the first cell of the endosperm, and the egg cell once fertilized become the zygote that develops into the embryo. The gap in the integuments through which the pollen tube enters to deliver sperm to the egg is called the micropyle. The stalk attaching the ovule to the placenta is called the funiculus.
A: Superior Ovary
If the sepals, petals and stamens, or their united bases (floral tube), arise from below the ovary it is superior. If the sepals, petals and stamens are free from each other the flower is hypogynous (compared with perigynous and epigynous.
In a floral formula a superior ovary is often depicted as follows, e.g. G (3) _. To remember whether the line goes above or below the number it can be useful to consider the number represents the ovary and the line as the point of attachment of the other floral parts.

Illustration from Clarke, I. & Lee, H. (2003) Name that Flower, Melbourne University Press, Victoria.
B:Inferior Ovary:
In an inferior ovary the sepals, petals and stamens, or their united bases (floral tube), are attached to the top of the ovary. In a floral formula the line goes above the G number, e.g. G (3)¯.

Illustration from Clarke, I. & Lee, H. (2003) Name that Flower, Melbourne University Press, Victoria.
C: Half or Semi-inferior Ovary
In a relatively small number of species the sepals, petals and stamens arise about halfway up the ovary and this is termed half- or semi-inferior.

Terminal versus gynobasic style
In most species the style extends from the top of the ovary. In some families (e.g. Lamiaceae and Rutaceae) the ovary is lobed and the style is inserted between the lobes.
In the following slide show a single ovary with multiple fused carpels.