I am trying to show that the discounted Geometric Brownian Motion SDE is a martingale, but I must be doing something wrong.
GBM SDE is given by $$X_t=X_0+\int_{h=0}^{h=t}X_hr dh+\int_{h=0}^{h=t}X_h\sigma dW_h$$ and the martingale condition should be that $$\mathbb{E}[e^{-rt}X_t|e^{-rs}X_s]=e^{-rs}X_s$$
Applying this condition (taking $t=s+u)$:
$$\mathbb{E}[e^{-rt}X_t|e^{-rs}X_s]=e^{-r(s+u)}\mathbb{E}\left[X_0+\int_{h=0}^{h=s+u}X_hr dh+\int_{h=0}^{h=s+u}X_h\sigma dW_h|e^{-rs}X_s \right]=\\=e^{-r(s+u)}X_s+e^{-r(s+u)}\mathbb{E}\left[\int_{h=s}^{h=s+u}X_hr dh+\int_{h=s}^{h=s+u}X_h\sigma dW_h \right]=\\=e^{-r(s+u)}X_s+e^{-r(s+u)}\int_{h=s}^{h=s+u}r\mathbb{E}[X_h] dh =\\=e^{-r(s+u)}X_s+e^{-r(s+u)}\int_{h=s}^{h=s+u}rX_0e^{rh} dh =\\=\left(e^{-rs}X_s\right)e^{-ru}+X_0e^{-r(s+u)}\left[e^{rh}\right]_{h=s}^{h=s+u}=\\=\left(e^{-rs}X_s\right)e^{-ru}+X_0e^{-r(s+u)}\left(e^{r(s+u)}-e^{rs}\right)=\\=\left(e^{-rs}X_s\right)e^{-ru}+X_0-X_0e^{-ru}\color{red}{\neq}e^{-rs}X_s$$
It is better to use the solution instead of the SDE. Under the risk neutral measure: $$X_t=X_0e^{(r-(1/2)\sigma^2)t+\sigma W_t^Q},\,X_0=x_0>0$$ Of course $E^Q[X_t]=X_0e^{r t}<\infty,\,\forall t$. So $$\begin{aligned}E^Q[e^{-r(t-s)}X_tX_s^{-1}|\mathscr{F}_s]&=e^{-(1/2)\sigma^2(t-s)}E^Q[e^{\sigma(W_t^Q-W_s^Q)}|\mathscr{F}_s]=\\ &\stackrel{W_t^Q-W_s^Q\,\stackrel{Q}{\sim}\, \sqrt{t-s}Z\sim \mathcal{N}(0,t-s)}=e^{-(1/2)\sigma^2(t-s)}E^Q[e^{\sigma\sqrt{t-s}Z}]=\\ &=e^{-(1/2)\sigma^2(t-s)}e^{(1/2)\sigma^2(t-s)}=1\end{aligned}$$ So $X_te^{-rt}$ is a martingale.