Apples grow on trees in Mondstadt and Liyue, but there are more in the former. You can't get them in Inazuma by foraging. Occasionally, you can find them in hilichurl boxes or random investigate spots. As for vendors, Bolai in the Liyue docks sells 10 Apples for 240 Mora each. Come back every three days to get your fill of the fruit!