If you’re holding the dollars because you think they’ll appreciate then it is kind of an investment. Same with euros. Dollars are printed by the federal reserve but if you think about it they’re really securities like any other. It just so happens that this particular security is widely accepted to cover debts in the United States, hence its value. Holding dollars is a bet on the United States. If you thought the US was going to collapse you’d certainly try and hold less dollars.