godan verb (-ru), intransitive verb
persevere; keep at it; do one's best; hold out
The most common use: continuing with effort despite difficulty, or giving encouragement with forms such as 頑張って. It is grammatically intransitive, though it often appears with an activity in casual Japanese.
つらいけど、最後まで頑張ります。
It's tough, but I'll do my best until the end.
明日の試験、頑張ってね。
Good luck on tomorrow's exam.
godan verb (-ru), intransitive verb
insist; stick to one's opinion
Used when someone stubbornly maintains a claim or position, often with a quoted statement plus と. This is less basic for learners than the encouragement sense.
彼は「そんな約束はしていない」と最後まで頑張った。
He insisted to the end, 'I never made such a promise.'
godan verb (-ru), intransitive verb
remain in place; stick to one's post; refuse to budge
A limited, older-sounding or literary use for physically staying put or holding a position. In ordinary modern speech, words such as 踏ん張る or 動かない may be more natural depending on the situation.
古い文章では、「兵が砦に頑張る」のように、持ち場にとどまる意味で使われることがある。
In older writing, 頑張る may be used as in 'soldiers remain at the fort,' meaning to stay at one's post.