What would be an optimal difficulty curve in Pokémon games? Maybe like this?
1st gym = Level 10
2nd gym = Level 20
3rd gym = Level 30
4th gym = Level 40
5th gym = Level 50
6th gym = Level 60
7th gym = Level 70
8th gym = Level 80
Elite Four = Level 90
Champion = Level 100
That's not a curve, it's a straight line. :p
More seriously, it wouldn't be that simple. There are a lot of factors that would go into something like that. Things like the distance between two gyms, the number of challenges between them, and so on, would add a lot of non-linearity to it (e.g. if you run into Team Universal Villains XVII in between the 5th and 6th gyms, the 6th gym would be at a higher level than usual as a result). There are also factors like how you usually pick up the game's legendary Pokémon somewhere around the 7th or 8th gym, so you could reasonably expect a spike in opponents' levels somewhere around there to account for the power a legendary adds to your party. In the end, you'd end up with a "curve" that actually contains a lot of spikes and troughs throughout.
There are other ways to add difficulty outside of just levels, too. Having opponent teams with more synergistic Pokémon and movesets and smarter AI (to utilise things like changing Pokémon based on who you send out) is the obvious one, or they could also do something like having the 8th gym be of a type strong against the game's legendary Pokémon so you can't just coast on its power. Or adaptive difficulty or something, where enemy teams can maybe scale slightly and change movesets and Pokémon based on the levels of your team.
I haven't played a Pokémon game in years so I dunno how much of this still applies to the series as it is now, but most of these things apply to basically any game with a levelling system.