Danny's ectoplasmic attacks affect the mind (subconscious), body (molecular level), and soul. Gojo's regeneration is Mid.
After doing some research, it doesn't seem like Danny has any answer to Infinity at all
Infinity works by dividing the space between the user and the attack into infinitely smaller fractions, thus preventing the user from being hit. However, this doesn't slow the attack down, this actually stretches the amount of distance between him and an attack. As Danny's ecto-blasts still follow the laws of physics in the sense that they have a speed stat and need to travel through conventional space in order to hit things, this should also work
Before you claim that these blasts would bypass space hax due to not being physical objects, picture this: If Danny uses an ecto blast against Gojo and it straight up ignored Infinity, then that attack would go from like sub rel (Danny's base speed) to infinite once it comes into contact with Infinity, since it needs infinite speed in order to travel that amount of distance in the first place. But why would the attack jump in speed just because it's encountering a space-based attack? That wouldn't make much sense
With this in mind, the fact that Danny Phantom characters don't have infinite speed means they still do follow the standard speed formula when moving or launching attacks, meaning Infinity works. I don't think Danny can really land anything. All of his attacks can be countered by Infinity
Danny doesn't kill humans but he's not going to see Gojo as a human so I wouldn't say he'd be against blasting Gojo. Also Danny Phantom ghosts true selves are type 1 abstracts on a conceptual level, touching Mahito's soul is not good enough to touch Danny's. He'd only be able to affect the avatar (Danny's physical manifestation), Unless spirits in Gojo's verse are type 1 abstract/concepts.
That's definitely a fair point, and no, JJK characters aren't abstracts, but like you mentioned, there's nothing stopping Gojo from destroying his physical body, in which if Danny regens, Gojo just pulls out Purple/UV which eventually incaps him
Not in character? Danny likes using possession on non ghost enemies to get what he wants. Considering Gojo isn't a ghost so Danny is actually inclined to use it. Also Six Sense says it sees curse stuff and analysis curse techniques. How does that allow him to understand the function of Danny because possession is simply Danny using intangibility, Gojo can't see the future, he'd only see Danny turning himself intangible to avoid an attack.
Cursed Energy in and of itself is the manefistation of humanity's negative emotions, which is literally what Danny is. Six Eyes should be able to see him and understand his techniques work. Even if this is the case, Danny still can't bypass infinity due to the reasons I mentioned above
TLDR Danny doesn't have an option to use against Infinity. Gojo's genius intelligence and Six Eyes will tell him pretty quickly that Blue, Red, and Purple don't work, and he doesn't really have anything else left to do except UV, which he probably will use.