There's a really nice and very gentle introduction to the modular group. It's called "Indra's Pearls, The Vision of Felix Klein" by David Mumford, Caroline Series and David Wright, Cambridge Univ. Press (2006). Another nice resource is Helena Verrill's Java applet: https://www.math.lsu.edu/~verrill/fundomain/index2.html.
An integer relation of the form a^n + b^n = c^n generates a very special elliptic curve y^2 = x (x - a^n) (x + b^n) . This gadget is called a 'Frey curve'. Coming from an entirely different direction, the brilliant Japanese mathematician Yutaka Taniyama conjectured that all elliptic curves are 'modular' - which means they can be parametrized by a modular curve. That conjecture was essentially proved by Andrew Wiles. Frey curves are much too special to be modular. This contradiction proves Fermat's Last Theorem. Let's find out a few things about all this. It's certainly a magnificent part of mathematics, full of really beautiful and symmetric objects.
Historical background includes Fermat's probable 'proof' from 1637, as well as the effort by Lamé which failed but spurred the development by Ernst Kummer of ideal theory for number fields around 1846. It is also worth looking briefly at how the ABC Conjecture implies FLT. It states that:
For all real e>0, there exists real K(e), such that for all (a,b,c) positive co-prime integers
a+b=c => c < K(e)*radical(a*b*c)^(1+e).
(radical(n) = product of the distinct prime factors of n.)