That's not how the international energy market works. You still have to buy your own, locally produced energy at international rates.
The huge energy price spikes are down to wars in Ukraine (gas, which is also used for electricity production) and the Middle East.
You don't have to, but you make more profit if you do. An energy producer that has the choice to sell energy for a lower price domestically or a higher price internationally will obviously choose the higher price, but you can make laws to make that illegal, if you want to.
Taiwan and perhaps other Asian countries that successfully make stuff don't expose their industries to this, the government sets a fixed energy price for them rather than leaving them at the whim of speculators.