Forward Rates and Spot Rates

Is the spot rate the geometric mean of the forward rates up to a certain time?

Given the spot rate from t = 0 to t = 3 is 5% and the forward rate at t = 4 is 4%, what is the formula for the spot rate from t = 0 to t = 4?

Yup.

I assume that you mean the 1-period forward rate starting 3 periods from today.

(1 + S4)^4 = (1 + S3)³(1 + 1f3) = 1.05³1.04 = 1.2039

1 + S4 = 1.2039^(1/4) = 1.047491

S4 = 0.0475 = 4.7491%

I wrote an article on calculating spot rates from forward rates that may be of some help here: http://financialexamhelp123.com/calculating-spot-rates-from-forward-rates/