Will is a genius and goes out of his way to work as a janitor in MIT. This is apparently because he enjoys exposure to complicated maths.
But what does he gain by being physically present at the MIT? He doesn't take classes there and he can't access any MIT specific labs (and the movie shows him not to use any labs anyway). Any books, papers or journals etc that he wants to read should be available in libraries elsewhere. There seems to be no compelling reason to take up a new job with a long daily commute and other overheads.
It couldn't just be to solve math problems occasionally posted by college professors either because the movie shows that he discovered it by random chance (I don't have the video handy but I remember he was shown to have come across it while just cleaning floors). Besides, if he really wanted to solve complicated math problems so badly then he would've been better off by taking a job at NSA etc.
So, what exactly does he get out of it?
Sean: There's honor, ya know, in taking that 40-minute so those college kids could come in the morning and their floors are clean and their wastebaskets are empty. That's real work.
Will: That's right.
Sean: Right, and that's honorable. Sure that's why you took that job. I mean for the 'honor' of it. I just have a little question here. You could be a janitor anywhere. Why did work at the most prestigious technical college in the whole fuckin' world? And why did you sneak around at night and finish other people's formulas that only one or two people in the world could do and then lie about it? 'Cause I don't see a lot of honor in that, Will. So what do you really want to do?