I use Ubuntu with ufw enabled. I connect to the Internet directly without a firewall. Are there any risks ?
Everything is risky, the question is, how risky. IT security is mainly about the effective estimation of the risks and costs and manage them.
The main fun in it is that the costs are so or so estimatable, but the risks can't. If you would know, how can your system be attacked, you could (in most cases) easily close the hole. This makes IT security more like an art.
In my opininon, your system is okay for ordinary home PC usage for common circumstances, i.e. turning your PC off and then running to the nearest hw store for a needless router would be an over-reaction.
Watch for that your firewall has a negative list (most ideal if only outgoing connections are allowed, or by default all incoming is denied, except the few what you allow). Furthermore, check that you have some DNS spoofing protection.
UFW is indeed a firewall, and blocks inbound packets from the outside world unless you explicitly open up a hole in the firewall.
Realistically, there's little difference between a properly configured software firewall, and having a hardware firewall between you and the rest of the internet. You can equally screw up a hardware firewall as much as you can a software firewall. In addition, most home firewalls are Linux based anyway, so any security vulnerabilities in the firewall are likely to exist in both devices.
It's even possible that having a software firewall on your computer is more secure than only having a hardware firewall, since your computer firewall is more likely to be automatically updated with newer security patches than a hardware firewall, which normally doesn't do this.
The only disadvantage to this setup is you don't have any local LAN to connect other devices in your home to the internet, since your computer has a publicly rotatable IP address rather than being behind a NAT. That's generally why people have a hardware NAT/Firewall, because they want to share the internet with multiple devices on their own LAN.
If your ufw is correctly set, nothing should happen. When you are behind "home" router there is usually one advantage and it is NAT. Because of it your PC is not exposed to the internet directly and even if rules on router's fw are not set correctly the 1:1 nat or port forwarding usually need to be configured separately and are not in use by default. But if you will use 1:1 NAT and you will have no FW rules at all it is the same as you have PC connected directly to the internet (based on default fw policy ofc. I assume it is allow-allow)
So in summary, there is only one difference and it is NAT. If FW rules are correctly configured, you should be OK. Just check if anything inbound except established and related traffic is disabled.