There are suggested items in the shop menu, but I've seen many streamers buy items other than the suggested ones. I understand that it's on a case-by-case basis, but I've also heard (from watching streams) that some items are worthless.
It depends on who is fed on the enemy team and how many characters they have in that role.
For tanks: If they have Yi jungle, Tryn top and Kog bot, I should go for Thornmail and Frozenheart.
When the AD carry is killed 5 times in 20 minutes, and their AP mid got free farm and/or kills, you need to focus on MR.
If you're an AD carry and the enemy has a Thornmail, get a Wits End. It counters it (or so I have heard, I dont play that much as AD carry).
You need to know what champion you are playing and what role you need to play. Sometimes the suggested items don't fit the play style you are trying to play. An example of this is Gragas, I play him as an AP mage, however the suggested items are tanky items like doran's shield. One way to see what items champions benefit from is looking up guides on how to play heroes on websites such as mobafire or leaguecraft.
However building items to fit the siutation you are in and what heroes you're against is the most appropriate way of playing.
It all depends which champion you play. Builds are pretty standard depending on the champions you're playing, but they can vary depending on the lane matchup and the way the game is going. If the other team has a fed Ryze, for example, you might change your build a bit and go for a magic resist item.
Suggested items that Riot put are intended as guidelines for complete new players to the game. Item builds however will and should always vary based on the game, team comps, and everything that is happening. It is not a static thing.
What items to buy after depends on what items you want to build for your champ in that particular game (tank or damage) and what item you can afford at that time to build into the final item. If you need sustain to stay in lane, then you may have to buy crutch items so you don't lose your lane too badly (items that aren't in your final build, like dorans blade/ring/shield).
They aren't items that improve your stats, but when it doubt get a couple of wards. Wards win wars. Even "do work" champs should buy wards.
Buy items that compliment how a character plays. For Ranged AD that's usually stuff like IE, PD, etc. Just understand what you generally need in lane. As a damager dealer, you need more damage but also sustain. And if it's a ranged character, you probably want some crit and attack speed. Sustain is doubly important for top laners.
Don't neglect defense. Ever. A common mistake for people who are new to 30, or still getting there, is to assume that you just need to keep loading up on offense with damage dealers. That's not always true. Next time you are in a game where some character on the enemy team is facerolling, consider building some defensive items to counter act that person. It can turn a game around; failure to build defense usually just spells game over. When to buy defense just depends. If you are winning your lane you generally focus on damage/sustain/wards. If you are losing you might need to get some defense so you can survive harassment and keep farming/keep them off the tower.
Try to spend your early gold such that it maximizes your ability to keep winning once you return to lane. That's one reason people get 2 and even 3 Doran's items; they're pretty good for the gold you spend and provide immediate benefits (health, a boost to your damage type, and either mana regen or life steal). Hextech revolver is a great caster item because it only costs like 1240 gold, gives 40 AP, and spell vamp (and for like 900g more you can turn it into Will of the Ancients; it's a cheap way to get 80 AP, quite a bit of vamp, and an aura that could help teammates). Given her changes last patched, I think Irelia players are going to be more inclined to get some quick life steal (or bank on a Philo, since you'll be activating W more often).
Some items are worthless. They just overhauled it but barely anyone had cause to buy Hexdrinker before the last patch (I'm not sure that has changed; I can't comment yet). Some items tend to only be good for specific characters - Manamune builds on ranged AD were popular for awhile but it was not optimal (to put it another way - success when using a manamune build almost certainly could have come more readily by doing something smarter). But there are characters for whom it makes sense (really spammy characters like Urgot and especially Yorick).
It helps to discuss item builds in the context of specific characters, of course.
Everything is situational, and based on what champion you have, what role you're filling on your team, your team comp, the other team's comp, and how well you are doing.
Generally you should have an idea of what items you want to go for at the beginning of the game. For instance, as an AD carry you should build damage items. From there it depends. If the other team is really tanky, you'll need a magic pen item like Last Whisper. If their mages are giving you trouble, grab magic resist and defensive items like Bashee's Veil and Quicksilver Sash.
It all depends on the situation you're in. The recommended items are good for new players, but they are certainly not set in stone by any means.
As far as useless items, there aren't any truly useless items, some are just a lot more situational than others.