Work Done when more than one field exist Suppose we have two different electric field, $\vec{E_1}$ and $\vec{E_2}$ where
$\vec{E_i}$ are elements of $\mathbb R^2$
 $y>0 => \vec{E}$=$\vec{E_1} $ and
$y<0 => \vec{E}$=$\vec{E_2} $
Assume $\nabla \times\vec{E_i} = 0 $ and $\vec{E_i} = \nabla V_{i}(x,y)$  
Suppose we calculate line integral along the closed loop, which is rectangle centered origin and whose height, h goes to 0.
What is work done here? In my opinion there must be net work done since the there exist two different fields and
$E_{1||}\times\Delta{x} \neq E_{2||}\times\Delta{x}$ in general where  $ E_{i,normal}$ does not contribute to integral. But anyway we came to the point where we start, hence there is no change in potential.  
I think there is a contradiction here, if there is no change in potential also there should be no net work done.  
Could you kindly explain this?
 A: Actually you are absolutelly right. It can be demonstrated (if you want I can give you some expressions) that if the parallel components to the boundary is different from zero, the field will have some work over particles on closed trayectories if $E_{1||}\ne E_{2||}$.
This solution is unphysical, in the sense that the field cannot provide work to particles moving on closed trayectories: The energy of the particle (or equivalentlly the potential), depends only on the position of the particle. This is the reason why, in this kind of boundaries the condition  $E_{1||}=E_{2||}$ is imposed. I hope this will help you to clarify concepts!
A: For any electrostatic situation the closed line integral of E.dl will be 0 as we decrease h. This forces the parallel components of the electric field to be the same. 
Let l be the length of your closed line integral. xhat and yhat are the unit vectors
e.g 
lim(h->0) closed line integral of E.dl = (E_1.(l xhat))+(E_2.(-l xhat))=0
So, E1 parallel = E2 parallel. The electric field components are always continuous across the boundary. Our derivation is only true for electrostatics, but the results hold for electrodynamics. 
This result can be rewritten as 
E_1-E_2= (sigma)/(epsilon_0) nhat
Where nhat is the vector normal to the surface, in this case, in the ydirection. 
If we want to calculate the potential (phi) (work being the difference in potential from each side - I assume this is what you are asking), 
delta phi = phi_1-phi_2 = lim(h->0)(integral of - E.dl from -z to z) = 0
This is because as the path shrinks to zero, so too does the integral.  
Which implies that phi_1=phi_2. Or potential just above the boundary, equals the potential just below. 
However, the gradient of the potential inherits the disconinuity in E. Since E=-delV, 
delV_1-delV_2 = -(1/epsilon_0)sigma nhat 
Or more convenienty, 
dV_1/dn-dV_2/dn = (1/epsilon_0) sigma
Where dV/dn=delV.nhat, denoting the normal derivative of V. Also note sigma is the charge density at the boundary. 
So, the work change at the boundary, the difference to move across the boundary in a parallel (with the surface) direction, is 0. 
A: The two fields $E_i$ have the potentials $V_i$ but the filed $E$ is not defined for $y=0$ so its domain is not connected and it cannot be expressed as the gradient of the same scalar field in the two  connected components. 
So, as noted in OP, the work done on a loop that is not contained on a single connected component is not null, in general. It can be null only if we specify some ''smoothness'' at the border of the two connected components.
