He philosophized, quite happily unaware of the ghee.
In this sentence, what is the usage of unaware? Is it used as an adverb? If so, how do we call this usage like adjective as adverb?
It's an adjective, not an adverb. Note that comma after the main clause: it separates what follows from the main clause and marks it as a 'supplement', not integrated into the structure of the main clause. Note, too, that the phrase can in consequence be shifted to other positions in the sentence:
Quite happily unaware of the ghee, he philosophized.
He, quite happily unaware of the ghee, philosophized. (But this would call for the pronoun to have relatively heavy emphasis.)
Such a supplemental adjective phrase is understood to be 'anchored' to the nearest eligible nominal—in this case, he—and to act as a subordinate predicate of that nominal, implicitly simultaneous with the main clause. You could paraphrase this as two independent clauses:
He philosophized. [As he did so he was] quite happily unaware of the ghee.
In that sentence, unaware is an adjective. It modifies He. It means that while he philosophized, he was unaware of the ghee.
This is a common way to structure a sentence, though it occurs much more in writing than in speech. You can understand it by analogy with some more prosaic examples, like this one:
Terence arrived at the hotel, tired after a long day.
The comma helps indicate that the phrase claims something about the noun in addition to what the main verb says. There is usually an implication that the adjective applies at the same time as the main verb, and usually there is some connection with the main verb. The sentence above suggests that Terence arrived at the hotel in the evening or late afternoon, even though this wasn't explicitly stated. That's because of the implication that Terence was tired after a long day when he returned to the hotel.
The meaning is the same if you move the phrase somewhere else, where the reader can still understand what noun it describes:
Tired after a long day, Terence arrived at the hotel.
By the way, in your sentence, the word unaware is itself modified by an adverb, happily, which is modified by yet another adverb, quite.
Unless the context provides a reason why the reader should think that the speaker's lack of awareness of the ghee has some connection with his philosophizing, we normally wouldn't use this sentence structure. I found the original context, and indeed it provides a connection, even in the original version of the sentence:
…The philosopher got the required ghee, which he packed in a green leaf. On the way, he became lost in philosophical speculations. “Ghee,” he said to himself, “comes from cow’s milk. Cows eat grass, and yes, leaves, too.” On and on he philosophized, quite happily unaware of the ghee in the leaf in his hand melting gradually and dripping.
So, the connection is that because his mind was focused on abstract thoughts, he failed to notice that the ghee was dripping away, possibly even onto his clothes.
Also see this answer, which has some more typical examples of this kind of sentence structure.