Because the type of "5" is int.
If you want to detect if a type is nullable, and the underlying type, use something like this:
public static Type GetActualType(Type type, out bool isNullable)
{
Type ult = Nullable.GetUnderlyingType(type);
if (ult != null)
{
isNullable = true;
return ult;
}
isNullable = false;
return type;
}