int? a = 14;
int b = 17;
if (IsOfNullableType(a) && !IsOfNullableType(b))
{
    Console.WriteLine("int? a is of a nullable type, while int b -- not");
}

bool IsOfNullableType‹T›(T o)
{
    var type = typeof(T);
    return Nullable.GetUnderlyingType(type) != null;
}

// Output:
// int? a is of a nullable type, while int b -- not