The changes in word forms that indicate the grammatical function or category of a word within a sentence.