1) Derivation often changes the word's lexical category, but not always:
great (adjective) => great+ly => greatly (adverb)
dog (noun) => dog + house => doghouse (noun)
2) Inflection doesn't change the word's lexical category. It adds meaning: number, person, tense:
Number: dog (singular noun)...