This handwritten note first appeared in print in Fermat's Observations on Diophantus, a book published after his death by Fermat's son in 1670. As such, it became a famous bête noire which many, many leading mathematicians of the succeeding centuries unsuccessfully tried to prove.
On the contrary, it is impossible to divide either a cube into two cubes, a [fourth power] into two [fourth powers], or, generally, any power superior to the square into two powers of the same degree; I have discovered a truly marvelous demonstration of this which this margin is too narrow to contain.
After the English mathematician Andrew Wiles finally succeeded in doing so in 1994, using methods of higher mathematics of which Pierre de Fermat never could have conceived, let alone have encountered in his day, many professional mathematicians have concluded that Fermat must have later found out that what he first thought was an elementary proof of his theorem had a fatal, incurable flaw -- which is why no other reference to such a theorem was ever found in any of his subsequent writings.
(During his lifetime, mathematicians "published" their work by corresponding with others in the field known to them. Fermat communicated to one such correspondent his ingenious "proof by infinite descent" of the case where x, y and z are all fourth powers, but that is the only case for which we know for certain he had a proof. He had discovered that proof, as we see from his marginal comment quoted above, by the time he wrote it in ca. 1639, although he did not communicate it to others until much later. The proof assumed first that there was such a pair of fourth powers which added up to a third fourth power, and then showed that if such a pair existed, there would also exist a smaller such pair, which would then lead to a still smaller pair, and so on, and so on, down to an infinitely small such pair -- which is impossible with the natural numbers, whose absolutely smallest exemplar is 1. This was an important early example of "proof by contradiction": assume that a proposition is true, and then show that the assumption leads to a contradiction.)
I first came across Fermat's Last Theorem as a teenager, and spent many long hours trying to imagine what an elementary proof of it could look like. In college, I took a course in number theory, and really explored the entire subject in depth. The problem is that proofs for higher and higher exponents quickly became very complex. (Work done by others established early on that there could be no example disproving the theorem if the exponents were even, and that of the odd exponents, only those that were primes needed to be tested and proved, since all the of the remaining possible exponents would be multiples of some prime.)
In 1975 or so, my sister sent me a supposed proof of the theorem authored by a colleague who taught mathematics with her. I looked it over very carefully, and could not spot any flaw in the argument, which proceeded based on a very ingenious factorization of the expression xn + yn = zn. So I sent it on to a former roommate of mine who was now a professor of mathematics at a major university. In no time, he returned it to me with the flawed statement highlighted: the proof depended at one point on taking the absolute value of an expression. Since this was an illegitimate assumption which turned what could have been a negative quantity into a positive one (without multiplying both sides by -1), it disqualified the "proof". (My ex-roommate told me that people in his position received at least one such claim of a "proof" each week, and that part of the "curriculum" of becoming a professor of mathematics was to be able consistently to show that the claimed proofs could not be valid.)
I spent considerable time again with the factorization, trying to use it to reach a contradiction along the lines that Fermat himself could have done. No such contradiction, however, emerged. No matter how the different factors of the expression were broken down and analyzed, they kept their parity on each side of the factorized equation -- odd remained always odd, and even even. My plan for a parity contradiction evaporated slowly, over a considerable period of exploration.
I have not given up the quest, because I still have faith in Fermat, who was never known in his lifetime to claim he could prove anything for which subsequent mathematicians could not find an actual proof. It is too easy to opt out of the problem by saying that "Fermat must have found he was mistaken" -- if that is really the case, why did he simply not scratch out his marginal observation in Diophantus, instead of leaving it for posterity to discover, and take up his challenge?
It is quite possible to say that no single observation in the entire history of mathematics has ever been as fruitful, in terms of leading to ever higher methods of analysis, and to ever more proofs, than this one seventeenth-century observation of Pierre de Fermat, which I have quoted for you above.