Let's go for a detailed and rigorous proof.
Let us define our local currency $Y$ as the numéraire, i.e. the asset in terms of whose price the relative prices of all other tradeables are expressed. $X$ is therefore the foreign currency, whose price in terms of $Y$ is $X(t)$ at any time $t$.
Let $r_X(t,T)$ be the risk-free interest rate in currency $X$ and $r_Y(t,T)$ the risk-free interest rate in currency $Y$, for maturity $T-t$ and at time $t$. Both are continuously coumpounded. Let two portfolios of value $1$ (in terms of currency $Y$) at time $t$: $P_1(t)=P_2(t)=1$.
The first portfolio $P_1$ consists in buying currency $X$ at spot price $X(t)$ and investing this amount in the risk-free rate of currency $X$. The final value at time $T$ in currency $Y$ is therefore: $P_1(T)=X(t)*e^{(T-t)r_X(t,T)}/X(T)$.
The second portfolio $P_2$ consists in buying currency $X$ in the future at time $T$, and at a forward price $f(t,T)$ determined at $t$. In the meanwhile, the $1$ is invested in the risk-free rate in currency $Y$. The final value at time $T$ in currency $Y$ is therefore: $P_2(T)=e^{(T-t)r_Y(t,T)}*f(t,T)/X(T)$.
Note that the two portfolios are riskless and have the same initial value. Hence, by no-arbitrage we must have $P_1(s)=P_2(s), \forall s\geq t$, and in particular:
$$P_1(T)=P_2(T)$$
$$X(t)*e^{(T-t)r_X(t,T)}/X(T)=e^{(T-t)r_Y(t,T)}*f(t,T)/X(T)$$
$$f(t,T)=X(t)*e^{(T-t)(r_X(t,T)-r_Y(t,T))}$$
Hope this helps!