The two answers here say the idea was conceived from einsteins famous equation, I would not have denied them had they also shown how people arrived from that equation to fission and fusion!
I also believe that "still" every idea is based on experiments, and I would say the idea of atleast fission was born with the idea of radioactive decay!
Read here.
Under history of radioactive decay they have explained that at first becquerel thought that some sort of radiation like x-rays were tampering with his experiments and producing the observations but many-many experiments later dons by various scientists it was established that different types of decays can occur which lead to different types of resultant nuclei.
As soon as you check the equations for these decays and the masses involved, you would know there is some mass missing! (Note radioactivity was discovered in 1896, before the famous equation by einstien ) Now "if" the scientists had the equation, it was easy to see there was loss of mass as energy. But we should note that people had even started doubting the energy-conservation principle at that time, only when new particles were predicted and found which balanced the equations things began to settle.
But any of these decay equations did not release sufficient energy which would have made it immediatelg evident that there was release of energy during the fission processes! The history section of nuclear fission clearly states that fission was discovered after 5 decades of work on radioactivity, at that time physicists had lots of experimental data and the einstein equation to figure out that a part of mass was being lost as energy.
So, I would say experiments on radioactivity and the missing mass in equations for radioactive decay gave birth to the idea of energy generation of nuclear fission.
Now as far as fusion is concerned wikipedia's nuclear fusion page clearly states that :
Following the discovery of quantum tunneling by Friedrich Hund, in 1929 Robert Atkinson and Fritz Houtermans used the measured masses of light elements to predict that large amounts of energy could be released by fusing small nuclei. Building upon the nuclear transmutation experiments by Ernest Rutherford, carried out several years earlier, the laboratory fusion of hydrogen isotopes was first accomplished by Mark Oliphant in 1932.
You may give credit of discovery of fusion to either the experiments that led to idea of quantum tunneling, or the curiosity of robert atkinson and fitz houtermans for smashing light masses together. I prefer the latter, but thats just a choice I make.
PS: neutron which enables us to achieve fission was discovered in 1932, and fermi and his colleagues were experimenting bombarding uranium nucleus with neutrons and reported several fission reactions. This is all mentioned in the nuclear fission page, and must have been a crucial stepping stone to discovery of fission