Cables usually break at friction points. Typically:
- in either shifters
- where the cable is bolted onto the front derailleur (there is a better line at the rear derailleur)
- near the brake assembly (exactly where depends on brake model)
- in the brake lever.
So inspect visually those spots and feel them with your finger. Check for broken strands. If there are, change the cables; otherwise, you're OK.
As to how often? It depends on how you use your bike. I have bar-end and downtube shifters and shift a lot. My most frequently used bike – 5000-6000 km per year – needs a rear shifter cable every 2-3 years and a front shifter cable every 4-5 years (approx.). As for brakes, I have only changed a rear cable once, after 50 000 km.
I have changed housing more frequently, usually when I either reconfigure the bars and needed different colour, length..., when it is cracked or kinked.