Is $f$ holomorphic in $\mathbb C$? Let $f:\mathbb C\to \mathbb C$ such that functions $z\mapsto \sin (f(z))$ and $z\mapsto \cos (f(z))$ are holomorphic on the entire complex plane.  a) Is $f$ also holomorphic in $\mathbb C$?  b) If we additionally assume that $f$ is continuous, is $f$ holomorphic in $\mathbb C$?
Logic suggests that in point a) the correct answer is NO, and in b) YES, but I do not know how to prove it.
 A: You have already been told in the comments that the answer to the first question is negative.
Now, suppose that $f$ is continuous that both of those functions are holomorphic. Then so is$$z\mapsto\cos\bigl(f(z)\bigr)+i\sin\bigl(f(z)\bigr)=e^{if(z)}.$$Now, let $z_0\in\Bbb C$. Let $g(z)=e^{iz}$. Since $g$ is locally invertible (this follows from the fact that $g'$ has no zeros), there is a neighborhood $V$ of $f(z_0)$ such that its restriction to $V$ has an analytic inverse $h$. And, since $f$ is continuous, there is a neighborhood $W$ of $z_0$ such that $f(W)\subset V$. So, $f|_W$ is analytic, since it is equal to $h\circ e^{if}$ there.
A: To show a is "no", just let $f$ be a non-constant function taking values only in $2\pi\mathbb{N}$, so that $\sin(f) =0$ and $\cos(f) = 1$, which are holomorphic, but since $f$ is not even continuous it is not holomorphic.
For b, not that if $f$ is continuous, then around some $z_0 \in \mathbb{C}$ we have by continuity that $f(z)$ can be made to stay in a small neighborhood of $f(z_0)$ by continuity. At least one of $\cos$ and $\sin$ has nonzero derivative at $f(z_0)$, so by the inverse function theorem either $\sin$ or $\cos$ is locally invertible around $f(z_0)$ with holomorphic inverse. (If you are not comfortable with inverse function theorem, then just note that all I am saying here is you can pick a branch of $\arcsin$ or $\arccos$ which are analytic near $\sin(f(z_0))$). Then we have either $f(z) = \sin^{-1}(\sin(f(z))$ or $f(z) = \cos^{-1}(\cos(f(z))$ is, being the composition of two holomorphic functions, holomorphic in a neighborhood of $z_0$. Since $z_0$ is arbitrary, $f$ is holomorphic.
