There are a number of ICs that will do these functions. I would go to the Maxim and
Linear Technology sites. The downside is that most of these devices is that they
are only in surface mount packages and a lot of them come in packages without leads (QFN, LGA).
A part like the LTC4088 is nice. It has an input for the battery, an input for the
USB (or wall adapter) and a switching regulator.
You could also use separate ICs (but you are probably better off with a single).
There is a device that Linear Tech calls a PowerPath controller (LTC4412)
that performs the switchover function. You could add a MAX1555 Li-ion charger
for a low cost charger and add the LTC4412. Also there are devices called "Ideal Diodes"
that will perform switchover. These devices are FETs so you get a much
lower voltage drop than a Schottky.
The best solution depends on a couple of things you haven't mentioned -- system current,
battery capacity and recharge rates.
If you do not know the discharge characteristic of the battery you have a few options to estimate the time for a particular voltage drop.
1 - Perform an experiment.
For small drops, put a resistor equivalent to your circuit load across the battery. Measure the time for the drop to occur. Most batteries have a reasonable manufacturing tolerance so this value would be pretty close to the average.
2 - Estimate the time based on the battery chemistry.
For this method you need the effective energy capacity of the battery (mAh) at your particular current draw, and a function describing the voltage drop over time. These two values can be estimated by looking at the data sheets of similar parts
e.g. Alkaline batteries:
Typical 1.5V alkaline cells start of at 1.6V, drop quickly to 1.5V, then fairly linearly to 1.1V, and finally drop off past 1.0V quickly after that. You a very rough approximation would be that the energy remaining in the battery is a linear function of voltage difference.
Let d be the voltage drop, t be the time to drop, a be the current draw, and e be the battery energy.
Then drop / 0.6V * energy / current = time
i.e. 0.2V / 0.6V * 2800mAh / 10mA = 93h
e.g. Lithium batteries:
Lithium batteries tend to hold their voltage as their energy is used. So any drop probably happens as the last 5% is consumed. Thus time for the drop is
95% * energy / current = time
i.e. 0.95 * 2400mAh / 10mA = 228h
3 - Gut feeling
This is by far the most common method. It involves ingesting cups of tea and/or coffee to get the creative cogs turning, and making up a figure that is palatable to all involved. Be aware though that this cognitive dissonance must be passed on to the client in order to transform this imaginary figure into one that can be relied on.
Best Answer
If you want something simple and your battery voltage is maybe too small for using a zener diode, you can use some bipolar transistors for turning off the an LED in case the battery voltage is insuficient.
Consider the following circuit. If the battery voltage is high enough the LED will turn on with a current set by \$R_{LED}\$. The point at which the led is turned off can be regulated through the pot \$R_3\$.
EDIT #1
Here is an updated version whose threshold can be more linearly controlled via a pot too:
The value of \$R_3\$ can be roughly calculated to turn off the LED for a given battery voltage threshold \$V_{BAT,TH}\$:
$$R_3=(V_{BAT,TH}-V_Z-V_{BE})\dfrac{R_2}{V_{BE}}$$
For example:
$$R_3=(3V-2.1V-650mV)\dfrac{100k\Omega}{650mV}\approx 38k\Omega$$