What part of speech is "talking" in the following sentence?
"+ ing" construction of verbs is required to make: 1) present participle, 2) gerund and 3) verbal noun. Present participles are used in formation of tenses conveying tense oriented sense only. When used alone, present participles embody the qualities of both verb and adjective.
Gerund is a verbal noun (+ing form) may be used as a subject or object of a verb or object to a preposition. We call '-ing' form verbal noun if preceded by ' the' and followed by 'of' and the sense it embibes is predominantly noun- like. So all verbal nouns are not gerund.
In the instant example, "talking" is a gerund being object of the preposition "after". As 'talking' is born out of verb it takes 'to' and all that follows.
In the example
"Paula felt much calmer after talking to her grandmother."
"talking" is a gerund. Gerunds are verbs within their own constituents, i.e., "downstairs", but they are nouns "upstairs", since they are heads of a noun phrase. Here, "talking" is a verb taking "to her grandmother" as complement. You can tell it's a verb from the absence of a preceding article ("a talking ...") and from the fact that it could be modified by an adverb, e.g., "quickly talking to her grandmother". If "talking" were a noun, it could only be modified by an adjective, not an adverb (as in "a quick talking").
However, looking upstairs at what part "talking to her grandmother" plays in the entire construction, evidently this phrase is the object of the preposition "after". A simple noun phrase could stand in this position: "Paula felt much calmer after lunch." So, since the head of a noun phrase is a noun, we can identify "talking" as an upstairs noun. "Talking to her grandmother" is a nominalization of a sentence "she talked to her grandmother". That is why we could also have a perfect tense here, because it is a logical past tense, and past tenses get shifted to perfects in non-finite verbs: "Paula felt much calmer after having talked to her grandmother."
Such cases where there is a mismatch between the upstairs part of speech and the downstairs part of speech are generally puzzling for traditional grammarians, because they think of the part of speech as being an inherent property of a word.
Gerunds are upstairs nouns but downstairs verbs. Participles are upstairs adjectives but downstairs verbs.