Writing a complex function $f(x,y)=f(x+iy)$ as function of complex variable $z$. Is it true that to write a differentiable complex function $f(x,y)=f(x+iy)$ as a function of the complex variable $z$ one can replace real variable $x$ with $z$ and put $y=0$? If it is true (even under more conditions) then how can one prove it?
 A: Yes, that is true. If you already know that $f(x+iy)$ is holomorphic, the conclusion follows from the identity principle.
For example, assume that $f(x+iy) = x^2-y^2 + x + 2ixy + iy$.
Define a new function $g$, where $g(z) = z^2 + z$. (I.e. what you get by putting $y=0$ and $x=z$. Then $g(z) = f(z)$ whenever $z$ is real (by construction). On the other hand $g$ is holomorphic (obviously) and so is $f$ by assumption. 
Since $f$ and $g$ agree on the real axis, they agree everywhere by the identity principle for holomorphic functions. (It's enough to assume that $f$ and $g$ agree on a set with accumulation points.)
This is a common trick when solving Cauchy-Riemann's equations: e.g. given $u$, determine $v$ so that $u+iv$ is holomorphic. Normally, we want the answer in terms of $z$, not in terms of $x$ and $y$.
A: Assume that $f:\>z\mapsto f(z)$ is analytic in a region $\Omega\subset{\mathbb C}$ which intersects the real axis in an interval $I$. Then $f$ can be considered also as a complex-valued function of the real variables $x$ and $y$, which I write here as
$$\hat f(x,y):=f(x+iy)\ .\tag{1}$$
One has, e.g.,
$$\hat f_x(x_0,y_0)=\lim_{h\to 0}{f(z_0+h)-f(z_0)\over h}=f'(z_0)$$
and similarly $\hat f_y(x_0,y_0)=i f'(z_0)$. Putting $y:=0$ in $(1)$ we obtain the function
$$\phi(x):=\hat f(x,0)=f(x)\qquad(x\in I)\ ,$$
which is nothing else but the restriction of the original $f$ to $I$. 
Conversely: If you just know $\phi:\>I\to{\mathbb C}$ then $f:\>\Omega\to{\mathbb C}$ is completely determined by this information. E.g., if you have a Taylor development
$$\phi(x)=\sum_{k=0}^\infty a_k(x-x_0)^k$$
with $a_k={\displaystyle{\phi^{(k)}(x_0)\over k!}}$ then $f$ is given in a full complex neighborhood of $x_0$ by
$$f(z)=\sum_{k=0}^\infty a_k(z-x_0)^k\ .$$
Another example: If you have found out that in fact $\phi(x)={1\over 1+ x^2}$ then you can say that $f(z)={1\over 1+z^2}$ in some domain $\Omega$ containing the full real axis.
