Increasingly people are becoming paranoid about photographers shooting in public places.
As has already been stated elsewhere it is not illegal to be taking photographs in a public place of buildings or people.
For buildings you need to be in a public place. Be sensible. I don't suggest trying to photograph nuclear reactors or functioning military grounds and buildings.
For people apply common sense. Ask permission if there is an interesting shot, but of course you don't have to. Street photography doesn't always allow for this, but just use your brain. Don't take photos of kids if you can avoid it, that will just be a nightmare.
For those that don't know I am a police officer. I offer the following advice with a disclaimer: Don't sue me if it goes pear-shaped!
1) This can be applied to security guards too but bear in mind they have no legislative power to do pretty much anything different than an ordinary citizen.
2) Shopping centres, sports grounds, community centres are public places MOST of the time for the purposes of 'public place' legislation - ie 'disorderly conduct'. HOWEVER they are actually privately or government owned and permission to be there can be withdrawn. The permission to withdraw the right to take photographs in such a place can also be withdrawn, as is happening in a lot of shopping centres these days.
3) If approached by a police officer the first thing to do is BE NICE. If you don't pass the 'attitude test' you will not win. Ever.
4) If they ask what you are doing be frank and open. Don't be smart. Say you are an amateur photographer or whatever, and that you are taking **insert genre here** photographs.
5) Show them what you are taking and if they question the content (ie building or infrastrucure) explain why you took it. To a police officer the picture you took may be pointless (unless sinister). Let me explain. You take a picture of a boring everyday subject (say an electricity sub-station) with the intention of applying a brilliant photoshop effect to it to make it a work of art. All the police officer sees is a possible vandalism or terrorist target. SO upload some of your finished work covering all sorts of genres onto your mobile phone so you can show that you are serious. "See It IS art Officer!"
6) If a police officer asks you to delete your photography, I would decline. THERE IS NO LEGISLATIVE POWER FOR A POLICE OFFICER TO DO THIS. Explain this very calmly and state why you want to keep it. If it really doesn't matter you can always do what they say of course (but I know I certainly wouldn't). If they do MAKE you do it then you have legitimate reason to complain about their actions.
7) 99% of the time police are there because someone complained about what you are doing (usually they reckon that there is someone taking photos of kids). Remember this.
8) Suggest a course of action politely (don't tell them how to do their job though - the difference is in your tone of voice). For example:
"As you can see Officer I am not taking photos of kids/terrorist targets. Would you be able to let the person who complained know what I am up to so they can put their mind at rest. I'm sure they won't mind me continuing if they know what I am doing."
9) All police are different. 90% are easy to get along with and quite sensible in how they deal with this sort of situation. About 10% can be quite cynical, impatient and/or arrogant. That is exactly the same as any profession, and like other professions they give everyone else a bad name. Also bear in mind very junior officers may make bad decisions and decisions outside legislation when put on the spot by an 'unusual' job. They are often the ones walking the beat that may deal with this sort of situation. Don't treat them with contempt though - you won't have passed the attitude test if you do.
10) Police will often ask your name, date of birth and address. If you are not committing any offence generally you do not have to provide these. BUT you have nothing to hide so give them the details that they want so they can check you are not a criminal/terrorist/paeophile. It won't do any harm to you at all, and refusing might mean to the police that you have something to hide.
11) If the situation starts turning bad for whatever reason do what you are told. It is better than having to deal with a much more serious situation if you don't, even if they are entirely in the wrong. You can always involve the media and complain about their behaviour to higher powers later.
12) My gut feeling is that at least 95% of photographers that are put into this situation are male.
13) It's not rocket science, but I see people that haven't done much (if anything) wrong, go completely down the 'wrong' line when dealing with myself and colleagues, and once tempers fray there are several legislative options available that can get you arrested. So - KEEP YOUR COOL!!