Real and imaginary parts of a complex function Is it always possible to separate the real and the imaginary parts of a complex function ? And why ?
I always did it by calculations, but is there a theorem that says that the division in real and imaginary parts is always possible ?
 A: Here is your theorem:

Theorem. Given a function $f:X\to \Bbb C$ from some arbitrary set $X$ into the complex number. Then there are functions $f_R,f_I:X\to\Bbb R$ so that $f=f_R+if_I$.

Proof.
Define
$$f_R=\frac 12[f+\bar f],\qquad f_I=\frac1{2i}[f-\bar f],$$
where $\bar f$ denotes the complex conjugate of $f$. We show that $f_R$ is real. Note that a complex number $z$ is real if and only if $\bar z=z$. Therefore
$$\overline{f_R}=\overline{1/2[f+\bar f]}=\frac12\overline{[f+\bar f]}=\frac12[\bar f+\bar{\bar f}]=\frac12[\bar f+f]=f_R,$$
sufficed to show that $f_R$ is real. The same works for $f_I$. It remains to show 
$$f_R+if_I=\frac12[f+\bar f]+i\frac1{2i}[f-\bar f]=\frac12[f+\bar f+f-\bar f]=\frac12[2f]=f$$
and we are done. $\square$

Usually we denote
$$\mathrm{Re}(f)=f_R\qquad \text{and}\qquad \mathrm{Im}(f)=f_I.$$
Above theorem gives a handy way to compute these:
$$\mathrm{Re}(f)=\frac12[f+\bar f],\qquad \mathrm{Im}(f)=\frac1{2i}[f-\bar f],$$
assuming that you believe that the complex conjugate always exists.

Geometric intuition
Note that $\Bbb C$ is just another way to write $\Bbb R^2$, i.e. the 2D-plane of point $(x,y)$. Every complex number $z=x+iy$ can be associated with a point $(x,y)$. The real and imaginary part are the $x$- and $y$-coordinate respectively.
Think about a function $f:\Bbb R\to\Bbb C$. This is a complex function. But you can view it as a curve in the plane by associating $\Bbb C\cong\Bbb R^2$. This gives you $f:\Bbb R\to\Bbb R^2$, i.e. a curve. And it seems obvious that we can always extract $x$- and $y$-coordinate of a curve, right?
$$f(t)=(x(t),y(t))^\top.$$
A: The functions $\operatorname{Re}, \operatorname{Im}:\Bbb C\to \Bbb R$ are well-defined, and may, like any well-defined function that takes complex numbers as input, be composed with a complex function $f:\Bbb C\to \Bbb C$ to give the two functions
$$
{\operatorname{Re}}\circ f:\Bbb C\to \Bbb R\\
{\operatorname{Im}}\circ f:\Bbb C\to \Bbb R
$$
which extract the real part and the imaginary part of $f$, respectively.
A: Yes.
Take $f:\mathbb C\to\mathbb C$.
Then, by definition, for every $z\in\mathbb C$, the value $f(z)$ is a complex number. Therefore, $f(z)$ can be written as $f(z)=a+bi$. The "real part" of $f$ simply maps $z$ to its corresponding $a$, and the "complex part" maps it to $b$.
More rigorously, you can define $$f_r(z) = \mathrm{Re}(f(z)) = \frac{f(z) + \overline{f(z)}}{2}$$
and
$$f_i(z)=\mathrm{Im}(z)=\frac{f(z)-\overline{f(z)}}{2i}$$
and you can show that $f_r$ and $f_i$ both take only real values and that $$f(z)=f_r(z)+if_i(z)$$  
A: take a function $f:\Bbb C\mapsto\Bbb C$.
this function is $f(z)=w$. because we know from the definition of $f$ that both $z,w$ are complex i can rewrite it: $f(a+ib)=c+id$, but $c,d$ are not constant(well they can, but it doesn't matter), they depends on $z$, if they depends on $z$ it means that they are functions, hence $f(z)=c(z)+id(z)$.
more formal proof will be $f(z)$ has imaginary and real part, $\overline {f(z)}$ has the same real part and the opposite imaginary part. so ${f(z)}+\overline {f(z)}=2\Re(f(z))\implies \Re(f(z))=\frac{{f(z)}+\overline {f(z)}}2$ and the same we can do ${f(z)}-\overline {f(z)}=2i\Im(f(z))\implies \Im(f(z))= \frac{f(z)-\overline{f(z)} }{2i}$
the notation of $\Im$ is the imaginary part and $\Re$ is the real part
you can look at it as $g:\Bbb R^2\mapsto\Bbb R^2, g(a,b)=(c,d)$. here again we can see that $c$ and $d$ are depends on the input of the function, so we can write it as $g(a,b)=(c(a,b),d(a,b))$.
A: Yes, it can be done.
Remember that andy complex variable function can be written as $f(z) = f(x + iy)$, and this may provide, or mayn't, a simple (or less) possibility to decompose it into $g(x) + ih(y)$, or more generally and better:
$$f(z) = f(x + iy) = \Re(f(z)) + \Im(f(z))$$
Simple Examples
1)
$$ e^z = e^{x + iy} = e^x + e^{iy} = \sinh(x) + \cosh(x) + \cos(y) + i\sin(y) = \Re(e^z) + \Im(e^z)$$
2)
$$\sin(z) = \sin(x + iy) = \sin(x)\cos(iy) + \sin(iy)\cos(x) = \sin(x)\cosh(y) + i\sinh(y)\cos(x)$$
That is,
$$\sin(x)\cosh(y) + i(\sinh(y)\cos(x)) = \Re(\sin(z)) + \Im(\sin(z))$$
Less Simple Examples
$$\sqrt{z} = \sqrt{x + iy} = z^{1/2}$$
Here you need the complex numbers root evaluation, or the exponentialization
$$z^{1/2} = \large e^{1/2\ln(z)}$$
Then you will deal with the logarithm
$$\log(z) = \log(|z|) + i\arg(z)$$
Then we always may find monstrous examples but it's not the case.
For a rigorous answer, check 5xsum's one! 
