Definition:

According to The Free Dictionary By Farlex, the definition of synonymy is the quality of being synonymous, equivalence of meaning. And according to Wikipedia, synonymy has the definition of synonyms are different words with almost identical or similar meanings
Synonymy is frequently used in writing and literary. Words or expressions with the same or similar meanings are said to be synonymous. In other words, synonyms are words or expressions that share common semantic features.

Functions:

Synonyms can be used as a rhetorical device to make the expressions coherent, varied, and more colorful. Its use can renders the sentence to be free of monotonous repetition. English is a language which excludes repetition, so using synonymy may make your listeners feel more fresh and alive when you are talking.

Examples:
couch—sofa
homely—domestic
large—big—enormous


However, in most cases, synonyms may differ in one or more aspects. See as follows.
(1)Different in origin
In English, there are some pairs of synonyms one of which is developed from the native word while the other is borrowed from another language, som Enlgish synonyms may belong to words of different linguistic origin, some belong to different geographic varieties.
e.g.
Native words——Borrowed words
answer——reply
bodily ——corporal
friendly—— amicable
house—— mansion
Aglo-Saxon—— Latin ——French
ask ——question ——interrogate
belly ——stomach ——abdomen
time ——age—— epoch

British English ——American English
lift—— elevator
perol—— gasoline
tube ——subway

(2) Difference in the shades of meaning
For example, amaze and astound share the same denotation, but they differ in the degree of incredibility. Amaze ha the semantic feature" difficult of belief" while astound "extreme difficulty of belief."

(3)Difference in socio-expression meaning
According to the differences in emotional flavor, synonymys may imply approval, disapproval or neutral attitude of the speaker.
e.g. horse, steed, nag, plug, and charger differs, in socio-expressive meanings: horse is neutral, steed and charger imply aprroval while nag and plug may imply disapproval.

(4)Difference in stylistic meaning
Some lexemes can tell us something about the social relaitongship between the speaker and the hear and the context in which they are used. They may be found in formal or literay English at one end and in colloquial, familiar and even slang English at the other.

(5)Differences in collocation and distribution
Like the words charge, rebuke and reproach are synonymous in that they have the common denotative meaning"to blame", but the prepositions co-occurring with them vary like this:accuse...of, charge...with, rebuke...of,reproac...with/for. See, they are different in collocation.
Other synonyms have different distributions. E.g. similar and alike. They both denote" being almost the same in appearance, quality, character", but similar can be used either as premodifier or a a subjuect complement. We can say We have similar thoughts or Our thoughts are similar, and we can only say The twins are very much alike.


Reference

Yang Xinzhang. An Introdution to Linguistics. Beijing: Higher Education Press.
http://www.thefreedictionary.com/synonymy
http://en.wikipedia.org/wiki/Synonym

See also

http://www.synonyms.net/