I've only played acoustic and looking to buy a used electric. I don't really know much about electrics... Should I worry about the "guts" of an electric and weather they will malfunction in the long run? Or should I just concentrate on if it sounds good and not worry about the durability of the guitar.
Well yeah, it could happen.

Just hear if it sounds good, check if it's set up properly; pick up height, if the neck is warped, etc.

Mostly...the "guts" consist of pick ups...
Co-Founder of the Orange Revolution Club

-Esp/Ltd Ec-1000 w/ BKP Mules
-2-channel Titan
-Oversized Bogner 2x12 Cabinet
-Fulltone OCD
-RMC Picture Wah
-T.C. Electronic Nova Delay
-Larrivee D-03R
Thats the beauty of guitar

Most everything can be replaced long as the neck and body are in good care a guitar should last forever.
some guitars are as solid as hell like a decent fender strat, others (gibson sg) for example are not quite so robust, but as long as you treat your baby with respect it will last a lifetime no matter what make and model.
My gear:
Fender 50th anniv American Strat Deluxe NICE
Fender Eric johnson Strat SEXY
Gibson SG Special Gothic II RAW
Ibanez JS 1000 VERSATILE
Gibson Les Paul Custom OOH BABY
Mesa Boogie Dual Rectifier Head & Cab LET'S ROCK
Its not unheard of for the electrics of a guitar to be a bit 'temperamental', but so long as you look after the guitar this is pretty unlikely, and besides, the circuitry's so simple that as long as you have a basic knowledge of how to use a soldering iron, most problems are easily fixable. So basically, dont worry about it.
Here's a little list of things to check for:
*Looking from the bridge to the headstock, is the neck straight? Is it bent in any way? Necks should have a bit of outwards bend, but not an excessive amount.
*Check wherever parts of the guitar are joined - around the bridge and pickups, but especially the headstock and neck pocket. Are there any cracks? Cracks could lead to these parts breaking and costing you a lot more than you paid for the guitar in the first place.
*Does the fretboard appear to be in good condition? Cracks are indicative of improper maintainence of the guitar. Fretboards should be oiled at least once a year, depending on the type of wood.
*Do all the electronics work? Scratchy pots are easily replaceable, but pickups that don't work can cost you.
*Is the action at a decent level? Some guitars have warped so much that the super-high action is necessary to prevent fret buzz.
*Are all the frets worn evenly? If a fret is a lot lower than the others, you'll need to have the others levelled to prevent fret buzz and action problems.
*Is the hardware rusty? Rust on hardware that is in contact with strings can reduce string life and increase the risk of string breakage.

This is by no way a definitive guide, but a good place to start from.
"Everybody, one day will die and be forgotten. Act and behave in a way that will make life interesting and fun. Find a passion, form relationships, don't be afraid to get out there and fuck what everyone else thinks."
well any kind of damage/equipment failure is possible, but the beauty of guitar is they can be replaced, at varying costs.

the main thing is to take care of it.
Quote by T.S.R.
if i were a midget...id go masturbate in public because...hey, im a midget and i can get away with anything

Quote by yawn
I heard Hitler was a pretty good guitarist back in his day...

Quote by guitar?
You're a towel.
i've had my usa standard strat for almost 17 years now and the electrics have never shown the slightest hint of trouble. if you get a quality guitar you shouldnt need to worry about it.
I've been imitated so well I've heard people copy my mistakes.
- Jimi Hendrix
Thanks for the replies. I'm actually looking for a used beginner guitar and was just worried if the previous owner took care of it.
It's possible for electronics to fail. Over time, pots tend to wear and can get scratchy. Pickup toggle switches can wear out. If you've got a cheap guitar, then the likelyhood of something like that happening increases. But seriously, someone could last a lifetime with a starter Squier Strat and never have the slightest electronic problem. I have a 3 year old Gibson Les Paul, and the toggle switch crackles when I use it and it cutting out on the neck pickup, and one of the volume pots are already scratchy. Shìt happens.

But all this stuff is rather cheap to replace these days and shouldn't be a major concern..
Guitars: Custom Lado Earth 2000-3, Custom ESP Explorer, BC Rich KKV, Gibson LP Studio, Greco SG, El Degas Stratocaster, Agile AL-3000, LTD EX-351

Rig:Marshall JVM410H + Marshall 1960A, Boss Noise Suppressor