According to the martingale representation there exists a unique $g(t,\omega) \in \mathcal{V}(0,T)$ such that
$M_t = E[M_0]+\int^{t}_{0} g(s,\omega) dB(s); \ \ \ t \in [0,T]$
Find g in the case where $Y(\omega)=B^2(T)$ and $Y(\omega)=exp(\sigma B(T))$; where $\sigma$ is constant.
For the first case I tried Y=2\int^{T}_{0} B_s dB_S, but I cannot see where this would lead. It appears the martingale convergence theorem does not give many pointers in to how to find $g$.
Whenever we consider a process $(Y_t)_t$ of the form $Y_t = f(B_t)$ (where $f$ is a "nice" function and $(B_t)_t$ a Brownian motion), then by Itô's formula
$$Y_t - Y_0 = \int_0^t f'(B_s) \, dB_s + \frac{1}{2} \int_0^t f''(B_s) \, ds. \tag{1}$$
Since the stochastic integral is a martingale, this yields in particular that
$$\mathbb{E}Y_t = \mathbb{E} \left( Y_0 + \frac{1}{2} \int_0^t f''(B_s) \, ds \right).$$
If we rewrite $(1)$, we see
$$Y_t = \mathbb{E}Y_t + \int_0^t f'(B_s) \, dB_s.$$
This means that we have a martingale representation for any $t \geq 0$. Apply this for $f(x) := x^2$ and $f(x) := \exp(\sigma x)$, respectively.