It's not difficult to see that
$$X_t := \exp \left(\sqrt{2} B_t \right)$$
solves the given SDE. (You can either use Itô's formula to check it or use some standard methods for linear SDE's to obtain this solution.) Moreover, by Ito's formula:
$$f(t,X_t)-\underbrace{f(0,x_0)}_{x_0} = \sqrt{2} \int_0^t e^{-s} \cdot X_s \, dB_s + \int_0^t e^{-s} \cdot X_s + (-e^{-s} \cdot X_s) \, ds \\ = \sqrt{2} \int_0^t e^{-s} \cdot e^{\sqrt{2} B_s} \,dB_s \\ \Rightarrow f(t,X_t) = \underbrace{\sqrt{2} \int_0^t e^{\sqrt{2} B_s-s} \,dB_s}_{M_t} + \underbrace{x_0}_{A_t}$$
where $x_0=1$. Let
$$g(s,w) := \sqrt{2} \cdot e^{\sqrt{2} B(s,w)-s}$$
Then $g \in L^2(\lambda_T \otimes \mathbb{P})$, i.e.
$$\int_0^T \int_\Omega g(s,w)^2 \, d\mathbb{P} \, ds <\infty$$
There is a general result which says that this condition implies that $M_t$ is a martingale (and not only a local one). Moreover,
$$\langle M,M \rangle_t = \int_0^t |g(s,w)|^2 \, ds$$
(see René L. Schilling/Lothar Partzsch: "Brownian Motion - An Introduction to stochastic processes", Theorem 14.13).
Concerning the integral $\mathbb{E}(e^{-\tau} \cdot X_\tau)$: Remark that
$$\tau = \inf\{t \geq 0; X_t=2-t\} = \inf\{t \geq 0; \sqrt{2} B_t = \ln(2-t)\}$$
Now let
$$\sigma := 2\tau = \inf\{t \geq 0; \underbrace{\sqrt{2} B_{\frac{t}{2}}}_{=:W_t} = \ln (2-t/2)\}$$
where $(W_t)_{t \geq 0}$ is again a Brownian Motion (scaling property). Thus
$$\mathbb{E}(e^{-\tau} \cdot X_\tau) = \mathbb{E}(e^{-\tau+\sqrt{2} B_\tau}) = \mathbb{E}(e^{-\frac{\sigma}{2}+W_\sigma}) \stackrel{\ast}{=} 1$$
In $(\ast)$ we applied the exponential Wald identity (see remark).
Remark Exponential Wald identity: Let $(W_t)_{t \geq 0}$ a Brownian motion and $\sigma$ a $\mathcal{F}_t^W$-stopping time such that $\mathbb{E}e^{\sigma/2}<\infty$, then $\mathbb{E}(e^{W_\sigma-\frac{\sigma}{2}})=1$. (see René L. Schilling/Lothar Partzsch: "Brownian Motion - An Introduction to stochastic processes", Theorem 5.14)
I guess you could use the sequence $\tau_n=\inf\{t\,:\, N_t=n\}$ and then Corollary 6.14 (or 7.14 depending on the edition, it is called "martingale transforms") from Kallenberg's Foundations of Modern Probability yields the result.
The corollary states that $Y_t(W_t-W_{T_{N_i}})$ and
$$\sum_{i=0}^{n}Y_{T_i}(W_{T_{i+1}}-W_{T_i})$$
are martingales for all (fixed / deterministic) $n\in \mathbb N$.
But in your case, you need that
$$\sum_{i=0}^{N_{t-1}}Y_{T_i}(W_{T_{i+1}}-W_{T_i})$$
is a local martingale for random $N_{t-1}$. This is why you need to stop the process.
With the stopping time suggested above, you obtain
$$M_t^{T^n}=\sum_{i=0}^{n-1}Y_{T_i}(W^{T_{i+1}}_t-W^{T_i}_t)$$
which is a martingale.
Of course, you could also use the well known fact, that a stochastic integral with respect to continuous local martingale is always a local martingale. Then you still need to show, that stopping at $\tau_n=\inf\{t\,;\,|M_t|>n\}$ yields a uniformly integrable martingale. Because of the continuity of the process $M_t$, you get that $M_t^{\tau_n}$ is bounded by $n$ and any bounded local martingale is a uniformaly integrable martingale. Hence the result follows.
Best Answer
If we apply Ito's lemma to the function $f(x,y) = e^x \cos(y)$ you'll find that $$dM_t = M_t dX_t - e^{X_t} \sin(Y_t) dY_t$$ since $\langle X \rangle_t = \langle Y \rangle_t = t$ and $\langle X,Y \rangle_t = 0$. Since the stochastic integral against a continuous local martingale is again a local martingale, this shows that $M_t$ is a continuous local martingale. We also deduce from this that $$d \langle M \rangle_t = M_t^2 d \langle X \rangle_t + e^{2X_t} \sin(Y_t)^2 d\langle X \rangle_t = e^{2X_t} (\cos^2(Y_t) + \sin^2(Y_t))dt = e^{2X_t} dt$$ (where we have again used that $\langle X,Y \rangle_t = 0$) and so $$\langle M \rangle_t = \int_0^t e^{2X_s} ds$$