Thank you for playing the game! I can help with these questions.
The cave under the library town (likely Brevity Village), is probably Pattern Stone Cave. It's odd because there isn't anything that's stopping the player from travelling through the cave in this game.
Professor Scarlet gives a reward only if you show her 251 Pokémon, which is totally doable in this game. You've still got a ways to go!
If you play the first game, just remember that it's older and isn't of the same quality of my newer games.
But still, have fun with it!