In this paper, an analytical method for the free vibration of a three-layer, continuous sandwich beam with an elastic or viscoelastic core and arbitrary boundary conditions is presented. The characteristic equation for finding the natural frequencies and modes is derived by introducing a discrete-type Green function which is a discrete solution of the differential equation governing the flexural behaviour of a sandwich beam under the action of a concentrated load. The Green function can be obtained equally for a beam with a non-uniform cross-section as well as a beam with uniform cross-section, and it enables the setting up of the frequency equation in eigenvalue form, so that the free vibration of the beam can be analysed efficiently without any calculation using a trial and error method. The numerical solution is shown to have a uniform convergency and good accuracy, and some effects of varying the elastic or viscoelastic core shear modulus and depths of core on the natural frequency and loss factor of a continuous sandwich beam are evaluated.