In addition to Alex' excellent answer, I'd like to contribute the following which may be more accessible if you haven't heard about limits before and gives a slightly more concrete criterion for the 'u-shapes'. I will also assume that by u-shape you mean things that actually look a bit like a 'u' rather than just becoming large on both sides.
The u-shape you describe is called a parabola.
And indeed, you can recognize many of these by their equation:
First look at the graph of $y=x^2$, the simplest example of such a parabola. Now, if you have any equation like $y=Ax^2+Bx+C,\ A>0$, you can complete the square:
$Ax^2+Bx+C=A(x^2+\frac{B}{A}x+\frac{B^2}{4A^2}+\frac{C}{A}-\frac{B^2}{4A^2})=A(x+\frac{B}{2A})^2 + C-\frac{B^2}{4A}$, so this is the simple parabola you saw before, moved to the left by a distance of $\frac{B}{2A}$, stretched in $y$-direction by a factor of $A$ and finally moved upwards by a distance of $C-\frac{B^2}{4A}$.
If $A<0$, your parabola is turned upside down.
For equations with higher powers of $x$, it is more complicated to find out what its graph looks like. As Alex said, odd degrees (highest powers) never give u-shapes, while even degrees can give u-shapes but also 'w-shapes' - consider for example $x^4-3x^2+1$ and more intricate shapes.