Respuesta :

The underlined gerund in this sentence is the word hiking, given that gerunds end in -ing and act as nouns. Having this in mind, the gerund here functions as the subject of the sentence
What is a pleasant activity? - Hiking. 
That is the easiest way to determine the function of a word in a sentence.

Answer:

As a subject

Hope this helps!