This is not too hard if you know how to compute limits. First, the usual formula for interest compounded N times with a time period T isS(N) = P*(1+rT)^N,
where T is measured in years and r is the yearly interest rate. If the total time is t, then N=t/T, so you get a formula with T as a variable parameter:
S(t) = P*(1+rT)^(t/T).
You want to take the limit as T goes to zero in this to get continuous compounding. Notice that you had to get rid of N first. Since N grows as T shrinks, this complicates the problem. Removing N and using t to describe the total time gives a formula where t remains constant as T shrinks, so only one thing is changing and the analysis is simpler.
To take the limit, first take the natural logarithm of both sides (to get the exponent down where it is easier to work with), then move ln(P) to the left side and collect it with ln(S), and then rearrange the right side into a fraction:
ln(S) = ln(P) + (t/T)*ln(1+rT)
ln(S)-ln(P) = (t/T)*ln(1+rT)
ln(S/P) = ln(1+rT)/(T/t).
Now if you let T go to zero, the right side goes to 0/0, which means you can use L'Hopital's rule for limits. This tells you that taking the derivative with respect to T of the top and bottom (separately) will give the correct limit. So the new right side is
(r/(1+rT))/(1/t) = rt/(1+rT).
Therefore, taking the limit of the equation gives
limit(ln(S/P)) = limit(rt/(1+rT)) = rt/(1+0) = rt,
so for continuous compounding, you get the formula you want by exponentiating both sides of the equation to remove the logarithm, and then rearranging it:
ln(S(t)/P) = rt
S(t)/P = e^(rt)
S(t) = Pe^(rt).
As you can see, it is not obvious without going through the calculation. There is a slight shortcut if you already know the fact that limit(1+ax)^(1/x) = e^a, where the limit is taken as x goes to 0, The proof of this fact is basically the same as what I have given above, just with a variable x instead of T and some constants in different places. So this isn't really a shortcut, it just means you did the same work earlier and are now quoting it, but it's the same amount of work.
I hope this is what you were looking for.
--Stuart Anderson