I know that G.H. Hardy hated applied mathematics, and I think I remember he was 'tricked' into discovering the Hardy-Weinberg equilibrium. How was he tricked into doing this, and what did Weinberg have to do with it, if he was all related to this?
Hardy's personal friend and fellow cricket enthusiast, Reginald Punnett, put a special case of the problem to Hardy. They were both fellows of Trinity College and Gonville and Caius College, Cambridge.
According the this article on the genetics.org website :
... Punnett was perplexed as to why the dominant gene did not continually increase in frequency, and this is the problem he put to Hardy.
(Later in the article, Punnett claims the problem was framed as a mathematical one. See below.)
Social life revolved around the common meals, especially the evening “High-Table” dinner with its opportunities for relaxed conversation across the barriers between subjects. It has sometimes been said that Punnett put his genetic question to Hardy at one such dinner, but there is no evidence for this.
Punnett (1950) simply wrote that on his return to Cambridge from his lecture in London “I at once sought out G. H. Hardy with whom I was then very friendly.” He went on to explain that this was not only because they used to play cricket together, but also because they had acted as joint secretaries to a committee that had been lobbying for the retention of Greek in the Cambridge entrance examination. Nothing was more natural than that the wholly unmathematical Punnett should rub shoulders with the leading mathematician of the day.
“I put my problem to him as a mathematical one. He replied that it was quite simple and soon handed to me the now well-known formula $pr = q^2$. Naturally pleased at getting so neat and prompt an answer I promised him that it should be known as ‘Hardy’s Law'—a promise fulfilled in the next edition of my Mendelism (Punnett 1950).”
There is nothing here to suggest that any trickery was involved other than Punnett's claim that he posed the problem as a mathematical one. Hardy simply appears to be responding to a request from a friend. In Hardy's letter to Science, he comments on the simplicity of the problem : "Moreover, I should have expected the very simple point which I wish to make to have been familiar to biologists.”
Interestingly, despite Punnett's claim, the article also includes the following :
Hardy did not use the word “equilibrium” (as Pearson had), nor indeed did Punnett actually use the phrase “Hardy's law” in his book. But Hardy's law it became, and then the Hardy–Weinberg law (Stern 1943).
Regarding your question on the role of Weinberg, again according to the genetics.org article :
[Weinberg's] solution in fact preceded Hardy's (which was obtained independently).
Since Hardy was the first published solution, his name is attached to the result. Since the biological community recognise Weinberg's solution as having preceded Hardy's, the result is now known as Hardy-Weinberg.