In the literature i found the following lemma: Let $K$ be a field with $char(K)=0,$ $f$ a non-constant polynomial in $K[X],$ $f=cg_1g_2^2\cdot\cdot\cdot g_m^m$ the squarefree decomposition of $f.$ Then \begin{equation*} gcd(f,f')=g_2g_3^2\cdot\cdot\cdot g_m^{m-1}, \end{equation*} and $f/gcd(f,f')=cg_1g_2\cdot \cdot \cdot g_m$ is the squarefree part of $f.$
So i have $f'=cg_2^2\cdot \cdot\cdot q_m^m+ \cdot\cdot\cdot+ cq_1\cdot \cdot\cdot mq_m^{m-1}=cq_2\cdot\cdot\cdot q_m^{m-1}(q_2\cdot\cdot\cdot q_m+\cdot\cdot\cdot+q_1\cdot\cdot\cdot q_{m-1}m)$. But then $gcd(f,f')=cq_2\cdot\cdot\cdot q_m^{m-1}$ which is different than in the statement of lemma. Personaly I think it's typo but just want to make sure.
You are correct, but the statement in the book is not a typo either. It seems your issue is that the description of $\gcd(f,f')$ in the book differs from your description by a factor of $c.$ This is not an issue, however -- in an arbitrary ring, the GCD of two elements (if it is defined at all) is only well defined up to a unit. It is a standard result that $K[X]^\times = K^\times,$ so $c$ is a unit, and thus the GCD description you gave and the GCD description the book gave are both correct.
Let $R$ be a commutative ring (with $1$), and let $a,b\in R.$ An element $d\in R$ is a common divisor of $a$ and $b$ if $a = d a'$ and $b = db'$ for some $a',b'\in R.$ A common divisor $d$ of $a$ and $b$ is a greatest common divisor of $a$ and $b$ if moreover any common divisor $d'$ of $a$ and $b$ divides $d.$ So, the greatest common divisor of $a$ and $b$ is the "greatest" in the sense of the divisibility partial ordering on elements of $R.$ However, we can see that if $d$ and $d'$ are associates (i.e., $d = ud'$ for some $u\in R^\times$), then $d$ divides $d'$ and $d'$ divides $d.$ Therefore, if $d$ is a greatest common divisor of $a$ and $b,$ so is $d'.$ There is not necessarily a preferred choice of GCD of two elements in a general ring, like there is in $\Bbb{Z}$, but the ideal generated by any GCD of $a$ and $b$ is well-defined.
You can read more about this here or here. You might also find this interesting.