Saw the magnet mounts for your car and wondered if the magnet would cause problems with the memory
Only a magnet so powerful it'll rip the zipper off your jeans from 20 feet away.
Not unless the battery slams into the magnet hard enough to break the battery.
or other parts of the phone?
Same as the battery.
I read that it will cause problems with your compass, but would that mean GPS would be inaccurate, too?
If the compass uses a Hall-effect device, it will cause problems with the compass, but the GPS receiver has the same problem as the battery - if the phone doesn't smash into the magnet hard enough to cause physical damage, there's no problem. (The GPS will still show direction properly, because it uses location over time [Where were you one second ago? Where are you now? You must have gone in this direction.] to determine direction.)
A magnet near a compass, even a screwdriver magnetized by slipping on a steel screw, will drive a magnetic compass crazy (the compass is measuring such a tiny magnetic field - it was the most sensitive measuring device for centuries), but that's just because of the difference between the amount of Earth-magnetism in the vicinity of the compass compared to even one grain of lodestone (many orders of magnitude stronger), not because that one grain could pick up even a dressmaking pin. It's a tiny amount of magnetism, hardly enough to cause a glitch in a floppy disk, but MANY times stronger than what the compass is trying to measure. (My compass decalibrates every time I put it on my desk - there's enough magnetism caused by the closed metallic ring around the edge of the desk to cause that. Electricity flowing through a conducting loop causes magnetism - and turning on a flashlight 5 feet from the desk will do it.)
Bottom line - unless you're using one of those magnets used for "fishing" stuff up from the bottom of a lake, don't worry about it. You can put your phone in the same pocket as the magnetic key holder you use to detach your car keys from the rest of them. You may have to do the "3 axis calibration" on the compass the next time you need it, but you probably have to do that every time anyway. (That's turning the phone around 3 times on each of its 3 axes. That's how you calibrate the phone's compass - see
GPS Status & Toolbox.)
The compass sensor probably won't be working when you have the phone mounted on a magnetic holder ("north" will be "toward the holder", or some other direction relative to it), but the "compass" on the GPS app will still be accurate.