Morphology, the study of morphemes is a subfield of linguistics that focuses on studying the smallest lexical units of meaning in language, which are the internal constituent parts of a word. These smallest lexical units of meaning are called morphemes. Variations in pronunciations or, more properly, realizations, of these morphemes, these internal constituent parts, are called allomorphs. Take the morpheme stem "read" as an example. This has two allomorphs: one allomorph is realized sounding like "red" for a past tense action; the other allomorph is realized sounding like "reed" for a present tense action.
Morphology aims to understand the internal constituent parts of words; to understand morpheme relationships; and, in so doing, to understand how a language building relates to words' constituent parts, their morphemes. Bear in mind that while English is heavily reliant upon morphemes other languages, like Vietnamese, are not; they have few morphemes. A good example of this aim is offered by Geert Booij in The Grammar of Words: An Introduction to Linguistic Morphology. As Booij illustrates, "correctly" can be properly understood as being related to "correct" through the affixation of the adverb forming suffix -ly. On the other hand, "hardly" cannot be properly understood if thought of as related to "hard" through the affixation of -ly. In these cases, -ly functions two different ways. In fact, morphologists say in these cases -ly functions as two different morphemes. Similarly, as Booij shows, "taxability" and "taxonomy" cannot be properly understood based on the shared stem "tax." They must be understood based on the analysis of the internal constituent parts, their morphemes.
The function of morphology is to identify individual morphemes, which may be words or may be parts of words, and analyze their meaning and lexical function. To illustrate, the function of morphology is to identify the constituent parts of words like, for example, "hibernation." This is from the Latin word hibernal, for "wintry," to which the Latinate suffix -ate has been affixed, with the second Latinate suffix -ion affixed thereafter. English "hibernate" is a verb. Latin hiber- is a verb. Latin suffix -natus was originally affixed to hiber- but was replaced in English by -ate. Latinate -ate forms adjectives that may also be nouns when affixed to verbs (hiber-). Latinate -ion forms nouns when affixed to adjectives. We now know the morphemes in (very complex) "hibernation" are three: hiber- verb, Latin stem; -ate adjective/noun forming suffix for verbs; -ion noun forming suffix for adjectives. This exercise illustrates the function of morphology.