Suppose $f$ is analytic on a connected open set $D$ and $f'(z)= 0$ for all $z \in D$ Hi: I'm going through an intro to complex analysis book and of the exercises is  to show that $f(z)$ is constant given that it is analytic on a connected open set D and $f'(z) = 0    ~~\forall  z \in D $. Thanks for any help. It's not homework. I'm just getting into complex variables.
 A: EDIT: As J.J correctly pointed out, $f'(z)$ is already assumed to be $0$ in the whole of $D$. The problem I solved was: 
Assume f'(z)=0 in a connected, open subset of the region where $f$ is analytic. I will try to solve the actual problems posted, and not the ones inside of my febrile head.
If $f(z)$ is analytic , then so is $f'(z)$. Since $f'(z)$ agrees with the function $g(z)=0$ on the non-discrete set D (an open set in $\mathbb C$ is not discrete, i.e., it contains limit points, since it contains non-empty open balls), then $f'(z)=g(z)=0$ in the region D (by the often-called Identity theorem). Now you can use some form of Cauchy-Riemann to show $f(z)$ must be constant. Let $f(z)=f(x+iy)=u(x,y)+iv(x,y)$. Then you have that: $$u_x=v_y=0 ; u_y=-v_x=0 $$ . Then you see that both $u ,v$ are constant, so that $f(z)$ itself is constant.
EDIT 2: As pointed out, we never used the fact that $D$ is connected. We can use that, for $\mathbb C $ , or actually for Euclidean space in general, connectedness and path-connectedness are the same: So , we are given $f'(z)=0=u(x,y)+iv(x,y)$ in $D$. Assume, by contradiction that $f$ is not constant; say $U(x,y)$ is not constant; say $U(a,.) \neq U(b,.)$. Then we can use a version of the Mean Value Theorem applied to a path between the two unequal values, which would force $U_x \neq 0$ at some point in the path. We cannot use this argument unless we have path-connectedness --which in this case is the same as connectedness.   
A: Here is an alternative approach:
The key fact here is:
If $D$ is open and connected, it is path connected. In fact, the path can be taken to be piecewise smooth.
Let $z_1,z_2 \in D$ and let $\gamma:[0,1] \to D$ be a piecewise smooth connecting $z_1,z_2$.
Suppose $t_0 = 0 < t_1 < \cdots < t_n = 1$ are such that $\gamma$ is smooth on each interval.
Let $\phi(t) = f(\gamma(t))$, and note that $\phi'(t) = f'(\gamma(t)) \gamma'(t) = 0$ for all $t \notin \{t_0,...,t_n\}$. If follows that $\phi(t_k) = \phi(t_{k+1})$ for $k=0,...,n-1$, and from this it follows that $f(z_1) = f(z_2)$.
Since $z_1,z_2 \in D$ were arbitrary, it follows that $f$ is constant on $D$.
