.
Much more stronger statement is true:
Each of 25 pupils must choose a combination of 2 tasks from 5 possible tasks.
Use the pigeonhole principle to show that at least three pupils will choose the same combination of two tasks. (*)
I underlined the words/the terms that I added to make your formulation unambiguous.
According to my formulation, at least 3 pupils choose not only the same task, but the same combination of two tasks.
Proof
The number of combinations of 5 items taken 2 at a time is
= 10.
So, there are only 10 different combinations of 2 tasks that the pupils choose from 5 tasks.
Now consider these 10 combinations of 2 tasks as 10 pigeonholes, and consider 25 pupils as pigeons.
With it, apply the pigeon principle (which in other mathematical cultures is called "the Dirichlet's principle").
And you immediately will find at least 3 pigeons in one/(in some one) pigeonhole.
In other words, those 3 pupils that choose the same combination of two tasks.
It implies that the statement (*) is TRUE.
* * * Proved and Solved. * * *
Notice that I proved more strong and more accurately formulated statement than your original.
Also notice that even 21 pupils is just enough for the statement to be true.
On "pingeonholes principle" see this Wikipedia article.