what is its function?
They are the basic biochemical processes that constitute life.
Gene
. The transmission of genes to an organism's offspring is the basis of the inheritance of phenotypic trait. These genes make up different DNA sequences called genotypes. Genotypes along with environmental and developmental factors determine what the phenotypes will be. Most biological traits are under the influence of polygenes (many different genes) as well as gene–environment interactions. Some genetic traits are instantly visible, such as eye color or the number of limbs, and some are not, such as blood type, the risk for specific diseases, or the thousands of basic biochemical processes that constitute life.

what is meant by the term single gene trait A single gene encode slightly different versions of a protein, which cause different phenotypical traits. what is a gene? It is a sequence of nucleotides in DNA or RNA that encodes the synthesis of a gene product, either RNA or protein. how was it discovered initially? The existence of discrete inheritable units was first suggested by Gregor Mendel, he studied inheritance patterns in 8000 common edible pea plants.
wiki:15827884
Gene [SEP] Introduction
Some genetic traits are instantly visible, such as eye color or the number of limbs, and some are not, such as blood type, the risk for specific diseases, or the thousands of basic biochemical processes that constitute life. Genes can acquire mutations in their sequence, leading to different variants, known as alleles, in the population. These alleles encode slightly different versions of a protein, which cause different phenotypical traits. Usage of the term "having a gene" (e.g., "good genes," "hair colour gene") typically refers to containing a different allele of the same, shared gene. Genes evolve due to natural selection / survival of the fittest and genetic drift of the alleles.