Toothpaste is neither a solid nor a liquid. Instead, it is a colloid, a substance that contains minuscule particles blended into a liquid. It is similar to other mixtures that have properties of both solids and liquids while fitting into neither category completely.
Consider the behavior of toothpaste. When someone squeezes a tube, it oozes out, which is not consistent with the behavior of a solid, which retains its shape. However, when someone stops squeezing the tube, the toothpaste does not continue to run out, which a liquid would do. Other examples of colloids include pie filling and Play-Doh.