I am working through tensoranalysis and the notations of co-/contra- and invariant, guess I understand. If I have a linear transformation, and the coordinates of my vector transform in the opposite direction (i.e. "contrary") to the transformation, then the vector is called contravariant. An example would be position, if I shift my coordinate system an amount $\Delta x$ in the $x$ direction, the vectors which stay stationary must be shifted by $-\Delta x$ in the $x$ direction. Invariant are quantities like length or dot products. With the notation of covariant I have my difficulty, in my textbooks it is said that the gradiant transforms covariant under linear transformations, so I tried to come up with a simple example.
The simplest example I could think of would be the scalar function $f(x) = x^2$ on $\mathbb{R}^1$. Here the gradiant equals the first derivate or the slope of the function. If I shrink my units of measurements on the x-axis by $\frac12$, i.e. change my basis, I need to transform my coordinates contravariantly, i.e. $x^2$ becomes $(2x)^2 = 4x^2$. But here is the problem, the gradiant/slope changed from $1$ to $4$, that is not just lineary covariant??? It is transformed lineary-contravariantly-squared? But by using any function I could transform the gradient as much as I want? but if it is covariant it should also shrink by $\frac12$, or not?