If I (as a player character) cast the enlarge/reduce spell on an arrow, what weapon could it count as? Would it be a spear, pike, or staff if enlarged, and a dart, crossbow bolt, or just a twig if shrunk? Note that I do not mean a midflight arrow.
Ammunition unusable, it becomes an improvised weapon
If you were to enlarge/reduce an arrow, it would no longer be ammunition that would fit in your standard bow. It would be either too big or too small to use normally.
That makes using this object to make an attack an Improvised Weapon (emphasis mine).
Often, an improvised weapon is similar to an actual weapon and can be treated as such. For example, a table leg is akin to a club. At the DM's option, a character proficient with a weapon can use a similar object as if it were that weapon and use his or her proficiency bonus.
However, do note that Enlarge/Reduce does make some big changes to the object:
Enlarge. The target's size doubles in all dimensions, and its weight is multiplied by eight.
Reduce. The target's size is halved in all dimensions, and its weight is reduced to one-eighth of normal.
It will be up to the DM as to whether or not they think an enlarged or reduced arrow is similar enough to an existing weapon (including size and weight differences/similarities) and what weapon that may be. Whatever the DM decides is reasonable, but if they decide it doesn't closely resemble another weapon, then it just reverts to:
An object that bears no resemblance to a weapon deals 1d4 damage (the DM assigns a damage type appropriate to the object).
But given that potentially similar items like a javelin or spear are both the same damage die (1d6), I'm not sure the specificity matters if your DM feels that they apply (even with the size/weight issues.)
The spell's text isn't specific on that
While the spell allows you to enlarge an object, it doesn't provide a lot of explanation of what happens when one does that. You can, however, come up with a ruling (or agree on one with your DM) that fits with how weapons on an enlarged creature are affected.
Enlarge. The target’s size doubles in all dimensions, and its weight is multiplied by eight. This growth increases its size by one category—from Medium to Large, for example. If there isn’t enough room for the target to double its size, the creature or object attains the maximum possible size in the space available. Until the spell ends, the target also has advantage on Strength Checks and Strength Saving Throws. The target’s Weapons also grow to match its new size. While these Weapons are enlarged, the target’s attacks with them deal 1d4 extra damage.
Proposed ruling (with caveats)
For your javelin, when you enlarge it, and while it is under the effect of that spell, using the above guideline means that it would do 1d6 + 1d4 damage.
For your spear, if you wield it two handed, it would do 1d8 + 1d4 damage.
Given the text above I'd recommend making the spear "heavy" in this case. The "it's weight is multiplied by 8" is a rather significant change. Granted, the above text is "increase size of a creature" so you don't have to enlarge the weapon by that amount.
From the weapons table (Basic Rules, p. 48)
Spear weighs 8 pounds. (Tripling that would be 24 pounds!)
Pike weighs 18 pounds. (And it has heavy property)
For your arrow, multiplying the weight by 8 likely makes it unusable with the bow you are usually using. It would likely fall into a (light) javelin's weight range, but that's a kludge. The equipment list has each arrow weighing 1/20th of a pound (Basic Rules, p. 50) which would make it 8/20ths of a pound or about 1/5th the weight of a javelin. We once again see how, for equipment, this wasn't given the kind of attention that creature enlargement was.
When modifying a game feature like that, particularly one where the devs didn't apply a lot of detail to the game as delivered, you are likely to trip over some oddness (see the weight thing) and thus need to tailor it to make sense to you.