A risk-free security is an asset with a beta of zero (i.e., no systematic risk) If $\beta_i = 0$, then $ R_i = R_f + \beta_i (R_m - R_f) \Rightarrow R_i = R_f$
Yield on US Treasury securities is often used as proxy for risk-free rate
Use a long-term US Treasury security (i.e., 10, 20, or 30 years)
Equity Risk Premium (ERP) is the extra return that investors demand for putting their money in stocks, as proxied by the S&P 500, instead of Treasuries
Mathematically, $ERP = R_m - R_f$
The ERP can be different depending on the term of the risk-free rate used but consistency is key
For example, if $R_f$ in the CAPM is based on 10-year Treasuries, then ERP should be calculated using 10-year Treasuries
ERP is the average annual $R_m - R_f$ over a period of at least 35 years