How does the fact that every integral around a toy contour vanishes imply that the function is holomorphic? I know that if a function is holomorphic in the enclosed domain, then it follows that the integral around the contour vanishes. However, my question is rather, how does the other direction follow? If for every toy contour in some region D one has that the integral of f(z) vanishes, how does it follow that f is holomorphic in D?
My approach was, if the integral vanishes always, then there exists a holomorphic function F(z) such that F´(z)=f(z) for every z in D, but I dont get how does it follow that the derivative is also a holomorphic function?
Also, given z=x+iy and f(z)=max(0, x), which is not holomorphic on the unit disc since the derivative limit does not exist at 0, I am having some trouble computing the loop integral to actually see how it is nonzero.
I guess this is somewhat related to the Laurent expansion and the residue, which is the only non holomorphic term in the expansion but I am a litlle bit confused still. 
Any help is appreciated, thank you
 A: 
My approach was, if the integral vanishes always, then there exists a holomorphic function $F(z)$ such that $F'(z)=f(z)$ for every $z$ in $D$...

From there, we have the Cauchy integral formula:
$$F''(a) = \frac{2}{2\pi i}\oint_{\gamma}\frac{F(z)}{(z-a)^2}\,dz$$
where $\gamma$ is some simple closed curve enclosing $a$. That formula includes that $F$ is twice differentiable (if we go through the proof), and thus that $f$ is differentiable.

Also, given $z=x+iy$ and $f(z)=\max(0, x)$, which is not holomorphic on the unit disc...
I guess this is somewhat related to the Laurent expansion and the residue...

No. Those matters, the Laurent expansion and residues, are for dealing with functions which are holomorphic on a region except for some isolated points. Near those points, the function is invariably unbounded. That's not what's going on here.
In this case, we're looking at a function that's real-differentiable (except on the line $x=0$) but not complex-differentiable (on the right half where $x>0$). In order to evaluate the integral around a loop $\gamma$ enclosing a region $R$ here, we use Green's theorem:
\begin{align*}\oint_{\gamma}f(z)\,dz &= \int_a^b(g(X,Y)+ih(X,Y))\cdot (X'(t)+iY'(t))\,dt\\
&= \oint_{\gamma}(g+ih)(X,Y)\,dx+(-h+ig)(X,Y)\,dy\\
&= \iint_R \frac{\partial(-h+ig)}{\partial x}-\frac{\partial(g+ih)}{\partial y}\,dx\,dy\end{align*}
For the function we're looking at, the real and imaginary parts $g$ and $h$ are $x$ and zero respectively in the right half $x>0$, for partial derivatives $\frac{\partial(-h+ig)}{\partial x}=i$ and $\frac{\partial(g+ih)}{\partial y}=0$ respectively. Integrate that, and we get $i$ times the area - or, at least, the portion of the area with $x>0$.
We could also calculate the line integrals explicitly with a nice enough region, such as a rectangle.
