There is no discrepancy:
- Spanish for Dummies is teaching you what the prepositions mean in English;
- Duolingo is teaching you how to use them in Spanish.
Actually, the only reason you think the prepositions do not fit is because you are translating "close" (an adjective) as cerca (an adverb).
In English, "close" is an adjective. Its literal translation to Spanish would be the adjective cercano. And indeed, if you pick this translation, the expression "close to" should be translated as "cercano a":
The train station is close to the university.
La estación de tren está cercana a la universidad.
And so, the prepositions fit.
The problem is — nobody says that in Spanish! We don't use adjectives to talk about relative distances; we use adverbs.
In Spanish, cerca is an adverb. Its literal translation to English would be the adverb "near", which is most commonly used without a preposition, so we cannot use it as an example -- but we can make one with its antonym "far" and the Spanish lejos:
The train station is far from the university.
La estación de tren está lejos de la universidad.
As you see, the prepositions match once again.
This was just an attempt at rationalizing this particular use of prepositions, but rules are kind of blurry in Spanish and English as well (why do you say "far from" but "near to"? 🤷♂️). So as a general rule the best you can do is learn their uses by heart.