I'm sure if it's still under warranty you should be able to contact a branch of Nintendo customer support to organise to have it sent away for repair. The Operations Manual that came with it should have a section on warranty and making a claim.
If it's the New 3DS it should have at least a 12 month warranty that might be valid still. The old version is probably too old for them to still cover. I know in Australia that our Consumer Law overrides this warranty and dictates that if the product fails within an unreasonable amount of time (usually within 3 years for technology) you can still demand a replacement or repair as your right. Don't know about US law but it's worth researching.
If Nintendo won't repair it (under warranty or not) you might be able to find an independent tech repair store to do it, I don't know how much I'd trust them unless they're specialised or a registered Nintendo repairer though.
Good luck, sucks that you're having troubles. I'd be so worried if my 3DS started playing up like that.