The word "function" in you r directions may have confused you. What part of speech is bold in each sentence? Your choices were on the bottom:
Subject, Verb, Direct Object, Indirect Object, Predicate Noun, Predicate adjective, or Prepositional Phrase?
Now lets look at each question separately.
A. The student *with the highest grade* will win a free lunch.
This one will be a Prepositional Phrase. The key word in this sentence is the word "with."
The student with the highest grade *will win* a free lunch.
Both will and win are verbs.
B. Jerry *gave* Maria a set of diamond earrings.
"Gave" is clearly a verb
Jerry gave Maria a *set* of diamond earrings.
Set is a direct object. This is what Jerry gave.
C. The gym is *open* until nine o'clock tonight.
Open is a predicate adjective. It describes the gym.
The gym is open *until* o'clock tonight.
Until is a preposition. This sentence is flawed. It needs to tell a time. If the sentence read, "The gym is open until ten o'clock tonight," then "until ten o'clock," would be the prepositional phrase.
Fro more practice identifying the part of speech in these sentences, go to https://www.funbrain.com/games/grammar-gorillas to practice.