The new book by Sternberg (a freely available version is linked in the answer by Will Jagy) is very affordable and focused on just what you may need:
If you want something more detailed and explanatory than Nakahara's, as a good bridge to the more purely mathematical references, you should take a look at these excellent titles:
In particular I would recommend the new book by Eschrig to complement any general relativity or gauge theory courses, with the formal background; it is filled with geometric and visual motivation alongside the formal concepts and arguments. Nevertheless, these books do not focus on (pseudo)-Riemannian geometry per se, but on general differential geometry, trying to introduce as many concepts as possible for the needs of modern theoretical physics.
Most purely mathematical books on Riemannian geometry do not treat the pseudo-Riemannian case (although many results are exactly the same). That is why the books on "geometry for physicists", from easy to very formal level, are the best first approach to the mathematical background. Once you get into advanced general relativity, the most mathematical treatments are given by books like Wald, Hawking/Ellis, de Felice, Fré et al... where the physical study of the mathematics of pseudo-Riemannian geometry is explained. Check out the references mentioned in this other answer. You may also find useful this other answer on self-learning differential topology and differential geometry.