I said it didn't! Didn't you notice? And did you not notice that YOU said that
g(x) = cosx ,0=<x<pi/3
= 1+cosx , pi/3=<x<pi/2
so your g(pi/3)= 1+ cos(pi/3)= 1+ 1/2= 3/2 Not the 1/2 you use in
"lim h-->0- ((1/2)cos(h) +((root3)/2) sin(h) -(1/2)) /h "
You can't use two different "f(pi/3)" values in the two limits.
A simpler example: f(x)= 1 if x is not equal to a, f(a)= 2. What is the derivative at x= a? Well, for all x< a or all x> a, it is simply 0. Clearly \lim_{x\rightarrow a^-}f(x)= \lim_{x\leftarrow a^+}= 0. Does that mean f'(a)= 0?
No, it does not: the derivative at x= a, if it exists, must be given by
\lim_{h\rightarrow 0}\frac{f(a+h)- f(a)}{h}= \lim_{h\rightarrow 0}\frac{1- 2}{h}
and that last limit does NOT exist.
(It is true that if a function, f, is differentiable at, say, x= a, then \lim_{x\rightarrow a^-} f'(x)= \lim_{x\rightarrow a^+}f'(x)= f'(a)).