If composition of one function and the other holomorphic function is holomorphic, then the other should be holomorphic? Actually, this is an exercise on Rudin's Real and Complex Analysis:

Suppose $\Omega_1, \Omega_2$ are plane regions, $f$ and $g$ are nonconstant complex functions in $\Omega_1$, $\Omega_2$ resp. and $f(\Omega_1) \subset \Omega_2$, so that $h=g \circ f$ can be defined. If we know that $f$ and $h$ are holomorphic, is $g$ holomorphic as well? What if we know that $g$ and $h$ are holomorphic?

The easiest example will be a constant function, but the problem does not allow this. I found it difficult to find counter examples. Can anyone help me?
 A: I suspect Rudin's problem was intended to be a little broader in scope.
Let me deal with the second part first by giving an counterexample where $g,h$ are homomorphic, but $f$ is not.
Define the function $\lambda: \mathbb{C}\setminus \{0\} \to \mathbb{C}$ by $\lambda(z) = \log |z| + i \arg z$, where I am taking $\arg: \mathbb{C}\setminus \{0\} \to [-\pi, \pi)$. This is the principal branch of  $\log$  extended to include the ray $\{(x,0)| x < 0\}$. $\lambda$ is not continuous on this ray, hence not analytic on $\mathbb{C}\setminus \{0\}$. The point being that $e^{\lambda(z)}= z$ (on the appropriate region).
Then take
$\Omega_1 = \mathbb{C}\setminus \{0\}$, $\Omega_2 = \mathbb{C}$. Let $g:\Omega_2 \to \Omega_2$ be given by $g(z) = e^z$, and let $h:\Omega_1 \to \Omega_2$ be given by $h(z) = z$. Again, it is easy to see that $f = \lambda$ satisfies the equation $h(z) = g(f(z))$, for $z \in \Omega_1$. Thus $f$ need not be holomorphic.
Now for the first part. It turns out that if $f$ and $h$ are holomorphic, then $g$ is too. We must show that $g$ is differentiable on $f(\Omega_1)$. To simplify life, take $\Omega_2 = f(\Omega_1)$. Since $f$ is not constant, $\Omega_2$ is a region (Rudin, The Open Mapping Theorem).
First we show that $g$ is continuous. Let $\hat{w} \in \Omega_2$, then $\hat{w} = f(\hat{z})$ for some $\hat{z} \in \Omega_1$. By Rudin, Theorem 10.32, we can write $f(z) = \hat{w}+(\phi(z))^m$ in some neighborhood $V$ of $\hat{z}$, for some integer $m\geq 1$, and an invertible, analytic map $\phi$. Note that $\phi(\hat{z}) = 0$, and $|\phi(z)| = |f(z)-\hat{w}|^\frac{1}{m}$. Now let $w_k \to \hat{w}$, with $w_k \in f(V)$, and choose $z_k \in V$ such that $f(z_k) = w_k$. Then we have $|\phi(z_k)| \to 0$, and since $\phi$ is invertible and analytic, we have $z_k \to \hat{z}$. Then we have $g(w_k) = h(z_k)$, and since $h(\hat{z}) = g(\hat{w})$, we have that $g$ is continuous at $\hat{w}$.
Now suppose $f'(\hat{z}) \neq 0$. Then by Rudin, Theorem 10.30, $f$ has a local analytic inverse $\psi$ such that $\psi(f(z)) = z$ in a neighborhood $U$ of $\hat{z}$. This in turn gives $f(\psi(f(z))) = f(z)$, and since $f$ is non constant, $f(U)$ is a region. Then for $w \in f(U)$, we have $f(\psi(w)) = w$. Thus we have $g(f(\psi(w)) = g(w) = h(\psi(w))$ in $f(U)$. Hence $g$ is analytic at $f(\hat{z})$.
By Rudin, Theorem 10.18, we see that the zeros of a non-constant analytic function are isolated. In particular, the zeros of $f'$ are isolated. So, suppose $f'(\hat{z}) = 0$. Then $f'(z) \neq 0 $ for $z \neq \hat{z}$ in a neighborhood of $\hat{z}$. Hence $g$ is analytic for $z \neq \hat{z}$ in this neighborhood. Then Morera's theorem, along with Rudin, Theorem 10.13 and continuity of $g$ shows that $g$ is also analytic at $f(\hat{z})$.
Hence $g$ is analytic on $\Omega_2$.
A: if $\Omega_2$ is strictly larger than $f(\Omega_1)$, then $g \circ f$ doesn't depend of what $g$ does outside $f(\Omega_1)$, so you can pick $g$ non holomorphic there and still have $f$ and $h$ holomorphic.
As for the other question, if $g$ is many-to-one, such as $g(z) = z^2$, you can switch the arguments given to $g$ as you want as long as they get sent to the same image : here if $f$ is any function such that for any $z$, $f(z) \in \{-z;z\}$, then $g = g \circ f$, where $g$ and $g$ are holomorphic, but $f$ may not be.
