Time-limited signal Fourier transform
What you are asking about falls into the realm of spectral estimation, of which frequency estimation is a particular case. 

In general, with no prior knowledge about the frequencies in your original signals, you cannot do what you ask. One fundamental reason is aliasing. If you sample at some frequency \$f_s\$, you cannot distinguish input frequencies \$nf_s - f_0\$, \$nf_s + f_0\$ for different n from 0 to infinity. For example, if you sample at 100 Hz, you can't tell the difference between a 20 Hz input, an 80 Hz input, 120 Hz, 180, 220, etc.

Another limitation, if you know nothing about your input frequencies, is that the precision with which you can estimate your input frequencies is limited by the length of time you sample for. For example, if you sample at say 100 Hz for 1 s, you might (very roughly speaking) just barely be able to distinguish between a 20 Hz input and a 21 Hz input. If you sample for 100 s, you might barely be able to distinguish between a 20 Hz input and a 20.01 Hz input, etc.

These limitations apply whether you have an input that is formed by combining two independent sources or if you just have a single, pure, sinewave input and you want to estimate its frequency. Of course the second limit has some relevance if you have two inputs at closely spaced frequencies and you want to be able to separate them.

You may also be able to get some help with this at dsp.stackexchange.com, though the typical answer over there requires a substantial amount of mathematical background that may make them difficult to understand.