When does a vector component keep being a vector, exactly? English is not my native language, so please forgive my errors.
Consider this example:

This is a classic: an exercise requiring you to calculate the electric field produced by a charged ring on its axis. Here I will expose my reasoning to show you what I can't understand.


*

*Every small charge $dq$ on the ring is contributing to the electric field. Its electric field is obviously a vector: $$d\vec{E} = \frac{dq}{4\pi\epsilon_{0}r^{2}}\hat{u}$$

*We know that because of the symmetry, the $x$ components of the field behave "normally" meaning that they add together, but the $\bot$ components respectively cancel themselves. So we only consider the $x$ component of the field for our calculations:
$$dE_{x} = d\vec{E}\,cos\theta$$
from what I know, being $dE_{x}$ the component of another vector this should be just a number. However, I can also see that the simmetry facts make only the direction of the field constant, but the $dE_{x}$ field has still a verse depending on the positivity or negativity of the charges of the ring, so it cannot be just a number. My book, however, does like this:

*It introduces the $x$ field as a function of numbers:
$$dE_{x}(x) = \frac{\lambda dl}{4\pi\epsilon_{0}r^{2}}cos\theta$$

*It then proceeds to integrate, and it considers the final field still as a function of x but as a full fledged vector:
$$\vec{E}(x) = \frac{\lambda cos\theta \hat{u_{x}}}{4\pi\epsilon_{0}r^{2}}\int_{0}^{l} dl$$
Now, I get really confused here.


*

*First we isolated a component $dE_{x}$ which was not a vector.

*However that component still is a vector even if its direction is fixed, or maybe the book was just considering its magnitude. We are now considering the field as a function of a vector: $\vec{E}(x)$ that is equal to the product between the original field formula $d\vec{E}$ and the $cos\theta$ because of the simmetry.

*So in the final expression by the book we have the field as a vector, but also the $cos\theta$ which was isolating the $x$ component and then also the unit vector of the field is called $\hat{u}_{x}$!


Isn't this a repetition? As you can see, I am really confused. What, in this process of calculation, keeps being a vector and what not?
If it was to me without getting confused by any book I would just return to the step 2 of the first list, to the expression
$$dE_{x} = d\vec{E}\,cos\theta$$
and just proceed to the calculus
$$dE_{x} = \frac{dq}{4\pi\epsilon_{0}r^{2}}\hat{u}\,cos\theta$$
but I couldn't say how exactly these vectors interact.
 A: You cannot have a scalar equal to a vector.  
Starting from $d\vec{E} = \dfrac{dq}{4\pi\epsilon_{0}r^{2}}\hat{u}$ to get to the componet in the $\hat x$ direction  
$d\vec{E} \cdot \hat x = dE_{\rm x} = \dfrac{dq}{4\pi\epsilon_{0}r^{2}}\hat{u} \cdot \hat x =\dfrac{dq}{4\pi\epsilon_{0}r^{2}} \cos \theta$
A: A vector's component is also a vector. If we have a vector $\vec{v}$ in (for example) two dimensions, we can say that it is the sum of two components, which are its projections on the $x$-axis and $y$-axis. Mathematically:
$$\vec{v} = \vec{v}_x + \vec{v}_y$$
In the problem you are solving:
$$d\vec{E} = d\vec{E}_x + d\vec{E}_y$$
This a vector sum, of course. A vector's component is still a vector, it is not a scalar. If we want to talk about the modulus of the vectors however:
$$dE^2 = dE_x^2 + dE_y^2$$
We may also write this in terms of the angles. We would find:
$$dE_x = dE \cos\theta$$
$$dE_y = dE \sin\theta$$
So a vector is never equal to a scalar. 
A: First of all, an expression like
$$dE_{x} = d\vec{E}\,\cos\theta$$
can never be correct. If you have a vector on the right, you will also have a vector on the left. The correct expression would be
$$dE_{x} = d\vec{E} \cdot \hat{u}_x = \frac{dq}{4\pi\epsilon_{0}r^{2}} \underbrace{(\hat{u} \cdot\hat{u}_x)}_{\cos\theta} = \frac{dq}{4\pi\epsilon_{0}r^{2}} \cos\theta$$
which is indeed a scaler ("just a number", as you call it).

What is happening here is that we want to know the electric field vector
$$ \vec{E} = \begin{pmatrix} E_x \\ E_y \\ E_z \end{pmatrix}. $$
However, we know from symmetry, that two of these entries must be zero.
$$ \vec{E} = \begin{pmatrix} E_x \\ 0 \\ 0 \end{pmatrix}. $$
Now, because we already know which direction the field is pointing (along the $x$-axis), we only need to calculate the magnitude of $E_x$ to get our result. So we extract the scalar $E_x$ from the vector like this:
$$ E_x = \hat{u}_x \cdot \vec{E} = \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}\cdot\begin{pmatrix} E_x \\ E_y \\ E_z \end{pmatrix}$$
Now we want to know the contribution of a line element to the total field, which you have already given
$$d\vec{E} = \frac{dq}{4\pi\epsilon_{0}r^{2}}\hat{u}$$
But we only need the $x$-component, which is the projection of $d\vec{E}$ onto the $x$-axis, which is already given above
$$dE_{x} = d\vec{E} \cdot \hat{u}_x = \frac{dq}{4\pi\epsilon_{0}r^{2}} \cos\theta$$
from the geometry of the problem.
Then calculation for $E_x$ continues as in your post. However, in the end we want the electric field vector, so we need to substitute the magnitude of $E_x$ back into a vector that has only an $x$-component.
$$\vec{E} = \begin{pmatrix} E_x \\ 0 \\ 0 \end{pmatrix} = E_x \cdot \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix} = E_x \cdot \hat{u}_x$$
