I would like to find a nonconstant analytic function $f:\mathbb{D}\to\mathbb{C}$, where $\mathbb{D}\subset\mathbb{C}$ is the unit disc and $f$ is continuous on $\bar{D}$ such that $\Re(f(z))=0$ for all $z$ in a proper subarc of $\partial\mathbb{D}$.
My first instinct is to make a branch cut outside of $\bar{\mathbb{D}}$ to obtain a branch of the square root function, thus taking $\mathbb{D}$ to the upper half circle, then apply the transformation $z\mapsto z+\frac{1}{z}$ to obtain (more or less) the bottom half plane. Then, I could rotate the bottom half plane to have its boundary "line up" with the real axis. Would this be sufficient? Please let me know if I am being unclear.
If $u$ is any real-valued $C^\alpha$ ($0 < \alpha < 1$) function, then the harmonic conjugate $v$ of the harmonic extension of $u$ to the disc is also $C^\alpha$.
In particular, any Hölder continuous function is the real part of a holomorphic function on $\mathbb{D}$, continuous on $\bar{\mathbb{D}}$. In particular you can make $u$ vanish on a large arc.
Unfortunately the same is not true assuming that $u$ is just continuous. There are continuous functions on the circle whose harmonic extension to the disc has an unbounded harmonic conjugate.