Solution (source code)

= Solution

A martingale must be integrable. On the event $\{N_t=1\}$, $X_t=g(Y_1)$, so integrability of $X_t$ forces
$$
\int_0^1|g(y)|\,dy<\infty.
$$
For $s<t$, independent increments give
$$
\mathbb E[X_t-X_s\mid\mathcal F_s]
=\lambda(t-s)\int_0^1g(y)\,dy.
$$
Therefore the necessary and sufficient condition is
$$
\boxed{g\in L^1[0,1]
\quad\text{and}\quad
\int_0^1g(y)\,dy=0.}
$$