PH Page 190 has a section on different speeds that I think would apply:
If you have more than one speed…you can switch back and forth between your speeds during your move. Whenever you switch, subtract the distance you've already moved from the new speed. The result determines how much farther you can move. If the result is 0 ar less, you can't use the new speed during the current move.
Your Questions
If a creature with normal speed 30 entered the area after moving 15 feet, what is its remaining available movement?
You have a speed of 30 and move 15 feet. You then enter the area and you now have a move of 15 feet. Your already-traveled movement is subtracted from your move speed, which is 0 or less, so you can't use the "new" speed.
If a creature with normal speed 30/halved speed 15 starts in the area and moves 15 feet to exit the area, what is its remaining movement?
This is the opposite, you have a speed of 15, and move 15 feet and are out of the area. Your speed is now 30, and you've only used 15 feet, so have 15 more feet available.
Difficult Terrain
The section you are referring to is under the Speed heading, which states that "[t]he following rules determine how far a character or monster can move in a minute, an hour, or a day." Therefore, those rules wouldn't apply to in-combat movement since that has its own rules.
The rules for in-combat difficult terrain are found PH page 190:
Every foot of movement in difficult terrain costs 1 extra foot. This rule is true even if multiple things in a space count as difficult terrain.
Nothing about halved movement. Hence, I conclude that halved movement, at least in combat (since the spell in question has a duration of 10min, I don't see it being that useful outside of combat), means \$ \frac{speed}{2}\$.
The creature can move at half speed to avoid both effects.
Neither ball bearings nor caltrops state that a creature's speed is physically penalized, just that a creature can choose to move at half speed to avoid their effects. Then we can handle each consideration separately.
First, ball bearings (emphasis mine):
As an action, you can spill these tiny metal balls from their pouch to cover a level, square area that is 10 feet on a side. A creature moving across the covered area must succeed on a DC 10 Dexterity saving throw or fall prone. A creature moving through the area at half speed doesn't need to make the save.
Is the creature moving through the area of ball bearings at half speed? Then they are unaffected.
Next, caltrops (emphasis mine):
As an action, you can spread a bag of caltrops to cover a square area that is 5 feet on a side. Any creature that enters the area must succeed on a DC 15 Dexterity saving throw or stop moving this turn and take 1 piercing damage. Taking this damage reduces the creature's walking speed by 10 feet until the creature regains at least 1 hit point. A creature moving through the area at half speed doesn't need to make the save.
Is the creature moving through the area of caltrops at half speed? Then they are unaffected.
An area covered in both ball bearings and caltrops is no different. Is the creature moving through the area at half speed? Then they are unaffected.
Note that if the creature chose to move greater than half their speed across the combined area then they would be forced to make both saving throws, one against the ball bearings and one against the caltrops, possibly suffering one effect or the other effect or both effects combined.
Best Answer
Difficult Terrain generally negates the need to make a save for Ball Bearings
The rule for moving through difficult terrain states is actually found in 2 places (both Combat and Adventuring). I've quoted the second instance here because it includes an additional and important clause (in bold):
Ball bearings state that:
Two things are important to keep in mind here:
The rule for ball bearings does not distinguish between a creature that chooses to move at half speed versus one that is forced to move at half speed.
Two instances of the difficult terrain effect do not compound with each other.
Ball bearings do not explicitly use the term "difficult terrain. This is because difficult terrain forces a creature to move slower while ball bearings give the creature the option to do so. Because it's an option, they can't be described as causing difficult terrain.
But that is what they are effectively doing. One effect forces the character to move half speed, the other effect gives the character the option. But since the character doesn't actually have an option due to the first effect, the penalty for choosing to move at full speed through ball bearings is moot.
One important caveat: Certain classes have abilities that allow them to ignore the movement penalty for difficult terrain (also the Mobile feat and spell Freedom of Movement). In these instance, ball bearings would still require the character to choose to move at half speed or make the Dex save because ball bearings, while similar in effect, are not "difficult terrain" (because of their optional nature).