I am stuck in computing the quadratic covariation of the following two processes:
Let $0< y <r$ and let $(B_t)$ be a Brownian motion started at $y$.
Let $T_0 = \inf \{ t \geq 0 : B_t = 0 \}$ and let $T_r = \inf \{ t \geq 0 : B_t = r \}$. Also, set $Z_t= B_{T_0 \wedge T_r \wedge t}$. How can we prove that
$$ d \langle Z, B \rangle_t = \mathbf{1}_{ \{t \leq T_r\} } \frac{Z_t}{B_t} dt \quad \quad ?$$
Proof: We know that the claim holds true for $f=g$. Now, using $$ xy = \frac{1}{4} ((x+y)^2-(x-y)^2),$$ we get $$\begin{align*} &\quad \int_0^t f(s) \, dB_s \cdot \int_0^t g(s) \, dB_s - \int_0^t f(s) g(s)\\ &= \frac{1}{4} \left( \int_0^t (f+g)^2 \, dB_s - \int_0^t (f+g)^2(s) \, ds \right) - \frac{1}{4} \left( \int_0^t (f-g)^2 \, dB_s - \int_0^t (f-g)^2(s) \, ds \right). \end{align*}$$ Since both terms on the right-hand side are martingales, the left-hand side is also a martingale and this finishes the proof.
Hint: Find suitable $f$, $g$ and apply the above lemma.