How can a vector represent velocity and a position as well?

A vector can represent a position by thinking of it as specifying the displacement from the origin of your system of coordinates to the position in question -- hence such vectors are called position vectors, not strangely.

Since velocity by definition is the derivative of position, then velocity as well is a vector, derived by differentiating the position vector.

Continuing this train of thought, you can see why acceleration, force (derivative of momentum, which involves velocity), etc. are all vectors.