Yes, the flu shot will not give you the flu. You can have a mild reaction in the next 48 hours as it does activate your immune system (fever, mild body aches, etc) as well as have pain/redness at the site of the injection. But you do not develop the flu from the vaccine.
Getting a flu vaccine doesn't mean you have no chance of developing the flu however. The vaccine you get changes year to year and is based on what is predicted to be the most frequent strain(s) of flu that year. This is based on tracking the frequency of the strains worldwide and a general consensus by a panel of experts choices which strains to vaccinate against. This is made well in advance of flu season (for Northern Hemisphere, decision is made in February for the upcoming fall) so some years it ends up being way off the mark and offering little protection. Most of the time they are fairly accurate though. Here is an interesting link of how they decide:
How Are Seasonal Flu Vaccines Made?
Reasons why you may get the flu not long after being vaccinated is most likely that either you were exposed prior to vaccination and were still incubating the virus or were exposed not long after getting the vaccination before it is effective (does not protect you for 1-2 weeks after receiving it). Also it is not 100% effective for everyone. On that note, a lot of childhood vaccines don't always give lifetime protection like once though, especially the MMR (measles, mumps and rubella) vaccine. It is good to get a booster of this as an adult. When I had to have my immunity tested prior to school, I found out I was no longer immune to mumps and rubella.
It is a good idea for everyone to get the flu shot as it helps slow down the spread and protects those with weakened immune systems that can't get the flu shot or for those it does not work for. If you work in any healthcare field (including working at retirement/nursing homes), are older than 55 or younger than 18 you definitely should get it as well. Most think of the flu as a annoying inconvenience that they get over, but a walk in the ICU in the winter can show you just how dangerous the flu can be.
Source: I did sometimes pay attention in medical school
Edit: see prototypical4thliner's easier to read response above as well