I've noticed that you can teach your pet spells. How exactly do you go about this?
I think you use scrolls. You can make them in the Sacred Land's Secluded Shrine, or you can buy them from user shops.
For every sixteen points of intelligence your pet has, you get one Alchemy Point: these are what you use to cast spells with. The more you have, the better scrolls you can make and use - if you go to the Secluded Shrine it will only show you those scrolls your pet's intelligent enough to make.
If you look down in the Battle Forum under Useful Battle Threads you'll find all the detailed information you could ever want.