Sorry but your question is really too general to answer.
I'm sure some brave person will rush in where I fear to tread, but this is a complex issue: you need to go and look at an English grammar book to find all the cases. There are lots of exceptions and funny rules and overlapping cases and context dependent cases and so on and so on. You could quite easily use all three:
My mother is on the shopping centre
= e.g. My mother is standing on top of the roof of the shopping centre
My mother is at the shopping centre
= e.g. My mother has gone shopping and I am at home
My mother is in the shopping centre
= e.g. I am standing outside the shopping centre waiting for my mother.
- I am studying PhD at the university.
- I am studying PhD in the university.
In the above, both sentences are wrong. Inserting for a between studying and PhD would make sentence 1. correct. Sentence 2. would still be wrong, as in is the wrong preposition to use in this case:
- I am studying for a PhD at the university. [Correct]
- I am studying for a PhD in the university. [Wrong]
This is not to say that the construction in the university is inherently wrong. There are certainly some contexts where this would be the correct form to use. For instance:
- The monument is in the university.
- He is in the university.
It is not always easy to come up with a rule to determine the choice between at and in. Some cases are clear cut, as in my first round of examples below. Others are not always so, as in my second batch of examples, for speakers tend to leave a lot of things implied in speech and in writing. Hopefully, you will be able to infer these rules from my examples.
In academic contexts, use at when referring to the institution in general or to a specific one. Note, however, that one would use in for graduate school or college (largely American context). The construction in university is also correct (largely British):
- I am studying for a PhD at the university.
- I'm at Oxford for a PhD.
- I'm studying for a PhD in graduate school.
- I'm currently in grad school for a PhD.
- I'm a sophomore in college.
- I'm in university for a PhD.
- I am studying for a PhD at Harvard.
- I am studying for a PhD at the Indian Institute of Technology in Delhi.
- I'm a PhD student at ETH, Zurich.
- I'm at King's College, London.
- I'm a junior at Williams College.
I should point out that in college and in university are rather colloquial constructions, but that's why they're used in everyday situations! In more formal contexts, it would be better to use at college/ at university.
More examples using school, department and faculty both explicitly and implicitly. Generally, in is used for department, while at is used for faculty:
- I'm studying for a PhD in the physics department.
- I'm in physics at MIT.
- He's a professor in the Department of Biology at Harvard.
- Are you the only assistant professor in this department?
- I'm a PhD student at the Faculty of Social Sciences in the University of Copenhagen.
- She's a professor at the Faculty of Arts and Sciences.
- My son is a lecturer in criminology at the Faculty of Law.
- I'm a PhD student at the Cape Town University Faculty of Law.
- I am in the School of Engineering for a PhD.
- He's a professor in Biological Sciences at Cambridge.
- I am a PhD student at the Yale School of Architecture.
- I'm studying for a PhD in the law school at Harvard.
- I'm a PhD student at Harvard Law [School].
NB: I did not look up information from any grammar book. These are just examples I came up with based on my experiences as a native speaker, general observations of usage, and what sounds right!
Best Answer
There isn't going to be a quick way to match up propositions. There are some general rules that fit a majority of the cases but the exceptions abound.
Unfortunately, changing prepositions around will have drastic effects on its meaning. Instead of trying to catch and explain all cases, I have decided to simply use your examples and explain what they mean:
"On" is typical here and will be correct most of the time. Working on a project implies doing work related to the project and is similar to working on a house or working on a letter. You are performing an action (working) on an object (the project).
The tricky side of "on" comes with phrases like, "I worked on a farm." Working "on a farm" means doing work while located on a farm instead of working on the object of a farm.
A good test is to try replacing "worked on" with "completed": "I completed a project" or "I completed a house" sound fine while "I completed a farm" drastically changes its meaning.
Working "in" something is more akin to being located inside of the object. "I worked in a building." A "project" can certainly contain things and so you can technically work "in" a project.
Here, "at" is mostly referring to your physical location. You did work while being located at the university. This generally refers to students enrolled in the university but also applies to people who were just visiting or possibly working there in a way unrelated to learning (such as the janitor.)
Again, "in" here implies being "inside of" or "contained by" the university. To say, "I am in university" generally means to be enrolled in one of the university's programs. Unfortunately, it can also mean being physically inside of the university buildings... so I am not helping much.
The most common case is to say, "When I was at..." but there is a mix of things happening here. People will ask you "Where do you go to school?" The importance seems to fall on the physical location but this usage does not cover strange exceptions such as enrolling in classes over the internet where you never move from your chair but are considered "at" a particular university.
In any case, I hope this helped somewhat.