What is Dharma according to the Bhagavad Gita? Are hymns and worship of God compulsory in the Bhagavad Gita ?
Dharma, in spiritual context, can be loosely stated as right action. And what is the right course of action for a person depends upon many factors like time, place, situation, etc. Hence, dharma is subjective and varies from person to person. So the Gita states:
sreyan sva-dharmo vigunah para-dharmat svanusthitat
sva-dharme nidhanam sreyah para-dharmo bhayavahah [BG - 3.35]
It is better to do one's own duty imperfectly than to do someone else's duty perfectly. Even dying while performing one's own duty is superior; but the consequence of following someone else's duty is dangerous.
So Gita describes many different paths and practices for people of different order, nature and caste. Perfectly executing one's dharma (right action / duty) awards heaven. When Arjuna was unwilling to fight, Krishna reminds him of His duty and tells him, if he follows his kshyatriya dharma (warrior duty), then even by getting killed in the battle he'll attain heaven (hato vā prāpsyasi svargaṁ [BG -2.37])
But the fruit of all these kinds of laukika dharma (worldly duties) including the worship of the demigods is temporary heaven and the jiva keeps revolving in the samsara:
te taṁ bhuktvā svarga-lokaṁ viśālaṁ kṣīṇe puṇye martya-lokaṁ viśanti
evaṁ trayī-dharmam anuprapannā gatāgataṁ kāma-kāmā labhante [BG - 9.21]
Thus after experiencing the vast heavenly worlds, they return back to this mortal world when their stored up merits run out. Thus being influenced by the duties and injunctions of the three Vedas, those who desire material enjoyment repeatedly born and die.
So in Gita Krishna advises Arjuna to leave all kinds of dharma and surrender only to Him (God):
sarva-dharmān parityajya mām ekaṁ śaraṇaṁ vraja
ahaṁ tvāṁ sarva-pāpebhyo mokṣayiṣyāmi mā śucaḥ [BG - 18.66]
Abandoning all kinds of duties, surrender to Me alone. I will give you salvation from all sins, you need not worry.
And instead of worshiping gods, ghosts, manes, etc. who provide temporary material results He tells to practice devotion to Him:
man-mana bhava mad-bhakto mad-yaji mam namaskuru
mam evaishyasi yuktvaivam atmanam mat-parayanah [BG - 9.34]
Engage your mind on Me, become My devotee, worship Me and offer obeisances to Me. Thus being absorbed in My thoughts, you will surely come to Me alone.
But, is worshiping God compulsory?
No, of course not. In Gita, after describing everything to Arjuna, Krishna doesn't tell or compel Arjuna to do anything particular, but leaves the decision unto him completely and tells him to do as he likes after analyzing what He said:
iti te jñānam ākhyātaṁ guhyād guhya-taraṁ mayā
vimṛśyaitad aśeṣeṇa yathecchasi tathā kuru [BG - 18.63]
Thus I described to you knowledge more confidential than the confidential. Deliberate on this completely and then do as you like.
Nothing is compulsory in the Vedic system. Do what you like, but be ready to face the consequences. System of karma takes care of all. You just reap what you sow. So to answer your question, no, hymns and worship of God are not compulsory in Bhagavad Gita. But it strongly recommends to do so (surrender and devotion) for one's own spiritual progress.
Before looking in Gita we need to analyze the word "dharma" from a dictionary. Sanskrit has only about 2000 important verbal roots, from which the meaning of most other words can be derived. "dhar" means "to hold", "to uphold". The esoteric meaning of "dharma" is "something that provides stability", "the natural position". The common translations as "law" and "duty" are actually derivative.
Now we approach Gita
with the refined question of "what is the source of stability"? There are two answers given due to our dual identity -- for the material body and for the spirit soul.
For the body -- one should engage in work in accordance to his inborn nature.
BG 5.2: work is better than abstinance.
BG 3.35: there is no fear in performing fitting duties, even if not completed properly
BG 18.47: performing duties related to one's nature cannot be sinful. Those duties were described in the previous verses, 18.42-43 and are analysed as varna: brahmana/ksatriya/vaishya/shudra. Shudra will be perfectly happy when working as a shudra (e.g. performing arts), but totally distraught when working as a kshatriya (manager), regardless of his salary.
BG 18.48: the nature is inborn (and thus doesn't change during life). This is related to the three gunas and can be determined by an astrologer.
For the soul --- BG 18.66: give up all duties and surrender to me (Krishna says). Krishna is the source of everything (BG 10.8) -- as long as you have Krishna, there is no lack of anything. There is no need to separately endeavor for wealth, health, fame, beauty or knowledge, as Krishna will give all that (BG 9.22) and more. He can solely deliver anyone from any suffering (BG 12.6-7) and grant any boon, including liberation and love. Even the boons of the worshipers of demigods (other deities) are granted by Krishna (BG 7.22), because nobody else can actually grant anything independently. There can be at most one independent entity, everything else becomes inevitably subordinated. But it is your free choice whether to fight with inevitable reality or use it to your full advantage.
What stability is ultimately attained by engaging in the above mentioned duties? By performing material duties, only temporary stability can be obtained, because the entire material platform is unstable (BG 8.16). By going to the spiritual world, one is free forever. Krishna wants to enjoy and the natural duty of every living being is to assist in his enjoyments. Whoever comes to that conclusion (BG 7.19) is never ever disturbed again (BG 9.31) and can enjoy together with the Lord in any of His forms and worlds (BG 15.6) (which are many).
Does Bhagavad Gita discusses about "What is Dharma"?
Bhagavad Gita is said on the pretext of the fact that Arjuna & Krishna already are aware about Dharma. Hence it doesn't discuss about what is Dharma, but it discusses about how one should follow [Swa]Dharma.
Arjuna was well aware about various kinds of Dharma-s, so were other PAndava-s. Just that, Arjuna was facing hindrance due to the tough nature of war where he had to kill certain dear ones. He didn't find the war worthy enough.
Krishna also understands that, Arjuna is not bewildered on the path of Dharma, but is confused whether the Dharma which gives such agony, -- should be followed or not?
Hence Krishna primarily talks about liberation.
Still ... "What is Dharma" as per Gita?
The only near direct mention of "what is Dharma" is during the last chapter. The actions performed under the influence of Sattva is Dharma. Under Rajas, one doesn't know Dharma vs Adharma and under Tamas, one follows Vidharma.
BG 18.30 — The one who knows activity & retirement, duty & non-duty, fear & boldness and bonding & liberation properly, has SAtvika Buddhi.
BG 18.31 — The one who doesn't know Dharma & Adharma, duty & non-duty as it is, has RAjasi Buddhi.
BG 18.32 — Covered by darkness (Tamas), the one who believes Adharma as Dharma and believes other [thing]s also wrongly, has TAmasi Buddhi
All the DhArmik actions are listed for the SAtvika quality in various chapters, especially chapter 14 and 18.