You can create an image of a flute, but when you try to "play" it, the illusion reveals:
Physical interaction with the object reveals it to be an illusion, because things can pass through it.
But you can "play the invisible flute"
You actually can play a melody using the basic Minor Illusion cantrip:
If you create a sound, its volume can range from a whisper to a scream. It can be your voice, someone else's voice, a lion's roar, a beating of drums, or any other sound you choose.
It should be fine to "play the invisible flute" for the purposes of entertainment. You can also pretend you are playing a real flute (or a flute-like stick) while casting the cantrip.