Spells and Magic
Free spells gained when going up a level must be taken from the Core Rulebook.
Other spells must be purchased (or obtained via 'adventuring') before they can be learnt. The cost of these spells is higher than normal due to their rarity.
|Other Paizo Source||Rare||x5|
|Non-Paizo Source||Very Rare||x10|
This doesn't mean that all such spells are available (especially for non-Paizo sources).
As for Arcane spells, Divine spells can only be selected from the Core Rulebook unless the character has had a chance to study them first. Temples, NPCs or scrolls are possible sources. Temples and NPCs will generally charge for access to these spells.
Once studied, such a spell can be selected normally.
Costs are as for Arcane spells.
If you are a Psychic character (not permitted by default), then spells in Occult Mysteries, as well as any spells on your basic class list, can be used as your free spells when starting and levelling up. Otherwise they count as Uncommon, though a PC Psychic will probably have a source they can go to.