Does difficulty ever stop increasing? I know we don't have to worry about this for a very long time, but...

One argument against Bitcoin, and really, digital currencies as a whole, is that, in order to time blocks with reasonable predictability every 10 minutes throughout the life of the system, the resource cost of blocks (e.g. processing power and electricity) increases over time. This system thus assumes that the available processing power will always be increasing and that the cost of electricity necessary to operate that processor will be less than the revenue from block reward plus transaction fees, that mining will be profitable.

If the difficulty never stops increasing, what happens if increased resource costs cause mining to be unprofitable?
The difficulty actually does not continually increase. It has continued to increase recently because hashing power has continued to increase, causing blocks to be found quicker. Difficulty is calculated by taking into account how long it has taken for the network to create 2016ª blocks and adjusting the difficulty accordingly.

Here's some messing around in a Ruby interpreter to show it:

#two weeks, expressed in seconds
twoweeks = 60 * 60 * 24 * 7 * 2
# =&gt; 1209600
#the current difficulty as of the time of this posting
diff = 7988698.97
# =&gt; 7988698.97
#the difficulty if it took only a week to generate the past 2016 blocks
(diff * twoweeks) / (twoweeks / 2)
# =&gt; 15977397.94
#the difficulty if it took four weeks to generate the past 2016 blocks
(diff * twoweeks) / (twoweeks * 2)
# =&gt; 3994349.485


A pair of maximums keep the difficulty change from being too abrupt. It can never more than quadruple (four times, 400% of the previous difficulty) or more than quarter (one quarter, 25% of the previous difficulty).

ª A bug makes it be actually 2015 in the reference client, but that may be fixed at some point in the future.