Answer: infinitive functioning as a noun.
Explanation: an infinitive is the basic form of a verb, without an inflection binding it to a particular subject or tense, it can serve as an adjective, an adverb, or a noun. In the given sentence we can see an example of an infinitive in the words "to follow" and, in this case, it are acting as a noun, specifically as the direct object of the sentence (it answers the question "what is his greatest ambition?").