Is BigInteger immutable or not?

The operators ++ and -- are implemented in terms of the normal + and - operators, so in reality:

b++;

is equivalent to:

var temp = b;
b = b + 1;
<use temp for the expression where b++ was located>

Now, as commented, this might seem like it breaks immutability, but it does not.

You should instead look at this code as doing this:

var temp = b;
b = BigInteger.op_Add(b, 1); // constructs a new BigInteger value
<use temp ...>

This will leave two objects in memory, the original BigInteger value, and the new one, now referenced by b. You can easily check that this is what happens with the following code:

var x = b;
b++;
// now inspect the contents of x and b, and you'll notice that they differ

So the original object did not change, hence it does not break immutability, and to answer the new part of the question, this should be thread-safe.

This is the same thing that happens to strings:

String s1 = s2;
s2 += "More";
// now inspect s1 and s2, they will differ

Since BigInteger is immutable, b++ will be just equivalent to:

BigInteger temp=b;
b=temp+1;

After this operation, temp is recycled by the GC and the memory is freed.