Good advice so far. With 3 weeks to go, I would ride as much as I could until about 4 days before the race, mixing hills, speed, endurance. I base the intensity on how much time I have to ride. If I only have an hour, and it's not a recovery day, I will push myself pretty hard. If I have 4 hours on a weekend to ride, I just put in a nice steady ride.
Then the week of the race, I would do an easy ride on Tues, rest Wed, easy ride Thurs, rest Fri, then go race. Get there plenty early, you will be nervous. Have a plan for getting registered, and warming up. I take the start time, and work backwards figuring how long I want to warm up, time to register, etc.
What type of race? How long? Good luck, have fun and tell us about it!