die Aufgabe
task
A specific piece of work that has to be done, often as part of a larger activity, job, or education.
Meine wichtigste Aufgabe heute ist es, den Bericht fertigzustellen.
My most important task today is to finish the report.

task / function / surrender
Loading your saved state.
task
A specific piece of work that has to be done, often as part of a larger activity, job, or education.
Meine wichtigste Aufgabe heute ist es, den Bericht fertigzustellen.
My most important task today is to finish the report.

The noun 'die Aufgabe' (task/function/surrender) is derived directly from the verb 'aufgeben' (to give up / to assign / to mail). This connection explains the different meanings: you can 'aufgeben' a piece of work (assign it), 'aufgeben' a competition (give it up), or 'aufgeben' a letter (send it).
Der Trainer gab den Spielern die Aufgabe, ihre Pässe zu üben.
The coach gave the players the task of practicing their passes.
In the sense of work that needs to be done, 'Aufgabe' (task) is often combined with certain verbs. Typical phrases are: 'eine Aufgabe bekommen' (to get a task), 'eine Aufgabe erledigen' (to complete a task), 'eine Aufgabe lösen' (to solve a task/problem), or 'jemandem eine Aufgabe stellen' (to set someone a task).
Die Schüler müssen eine schwierige Aufgabe in Mathematik lösen.
The students have to solve a difficult math problem.
A very common construction is 'es ist die Aufgabe von jemandem, etwas zu tun' (it is someone's task to do something). This structure emphasizes the responsibility or function of a person or thing.
Es ist die Aufgabe der Regierung, für die Sicherheit der Bürger zu sorgen.
It is the government's task to ensure the safety of its citizens.
The meaning 'Beendigung' (ending/withdrawal) is almost always found in the context of sports, competitions, or fights. The surrender or withdrawal is often forced by external circumstances, e.g. by an injury or a technical defect.
Eine Verletzung am Knie zwang die Tennisspielerin zur Aufgabe des Spiels.
A knee injury forced the tennis player to withdraw from the match.
The meaning 'Abgabe einer Postsendung' (handing in/posting of a postal item) belongs to formal language, especially in official or business communication. It is often found in the terms and conditions of postal services.
Bitte bewahren Sie den Beleg über die Aufgabe des Pakets gut auf.
Please keep the receipt for the posting of the package in a safe place.
work
'die Arbeit' and 'die Aufgabe' can both mean something that has to be done. 'die Aufgabe' is usually more specific: someone is given it, or it belongs to a particular goal, for example at school or at work. 'die Arbeit' can mean this task, but also the whole effort or many activities together. Learners may confuse the words because a task is work. If you mean one clearly defined thing, 'Aufgabe' is more precise. If you mean the effort or the activity in general, 'Arbeit' fits better.

Am Abend erklärt er seinem Freund die schwierige Aufgabe.
In the evening, he explains the difficult task to his friend.
Heute hat mir die Arbeit im Garten viel Zeit gekostet.
Today, the work in the garden took me a lot of time.