You'll need an experimental radio license (Versuchsfunk) from Bundesnetzagentur link for research operation.
For demonstration/teaching purposes, a demonstration radio license (Demonstrationsfunk für Bildungseinrichtungen) would be in order.
I'm not a lawyer nor have I ever applied for either of these; I'd recommend contacting BNetzA on these aspects. Whenever I contacted them, they were super friendly and swift.
A loophole here might (again, ask BNetzA if in doubt) be general low power transmitter licenses as used by e.g. the small dongles that you can plug into your iPhone to make your car stereo receive on FM what your phone is playing. I know that there's a pretty low power limit for these (nW range), but that might be perfectly suitable for your use case. What I don't know is whether the devices in question need to be type-approved (which would rule out the HackRF completely, as it can do anything) or whether guaranteeing that your device won't do anything bad is sufficient at these power levels.