Answer: Gerund or gerund phrase: giving. Noun function: direct object.
Explanation: a verb form which functions as a noun, in English the gerunds end in "-ing." In the given sentence the gerund is the word "giving" and it is acting as a direct object (a noun phrase denoting a person or thing that is the recipient of the action of a transitive verb) because it answer the question "which is the greatest pleasure" (we can identify direct objects by asking "what" or "which" questions to the verb).