To know the frequency response of a system you first have to provide a stimulus that covers (as Alex says) the frequency range you are interested in, since if the system is linear (or almost linear, and if it is not the frequency response concept is not applicable) it will respond with the same frequency you are injecting into it.
The ideal signal to provide for testing would be a Dirac delta (which contains all frequencies with the same amplitude), but we know infinite is not possible to achieve, unfortunately.
Some of the usual signals used for testing a system are the frequency sweep (a "sine" wave linearly or logarithmically changing in time from one frequency to another, so that freq=k*t or freq=k*log(t) ) and step.
The sweep is used because it contains almost uniformly distributed all the frequencies in its range, and because it allows to obtain a graphical "bode" plot just using an oscilloscope and looking at the output wave envelope.
The step is used in control systems, where you want to see how the system behaves in response to a change (transient) and in its steady-state (DC).
If you apply a sweep to a system, and record both sampled input and output, to obtain a bode plot there are at least two ways. The simplest is looking at the envelope of the output divided by the envelope of the input (but this last should be almost constant), all represented in logarithmic scale (both time and amplitude). The other, more accurate, is to calculate the Fourier transform of both input and output, and then show their complex ratio (for each frequency value). Fourier transform gives the advantage of calculating phase, too.