I believe that both have infinite number of solutions. However, when looking into the chart of sin(x) and sin(x^2), it is quite obvious, that both the infinities have different cardinality.
I'd say that the number of solutions for cos(x)=0 has same cardinality as the set of all natural numbers. However, for the cos(x^2)=0, the cardinality would be as the set of all real numbers. At least, it is not greater.