Trivially: yes, of course you can. You almost certainly won't be able to ride that bike, though.
The problem is not the weight of the frame, it's the weight of the rider compared to the strength of the gold. Essentially you have an 80kg rider on a frame that might weigh 20kg if made of gold rather than 5kg in steel. The dominant mass is still the rider.
The problem is that the maths is complex and I'm not a mechanical engineer. Broadly, we need to find the yield force at which each key component breaks, and that's determined by how the gold is formed, the temperature, the rate of change of the force and a few other factors. So you can't just say "shear modulus 27GPa" and move on.
To make a bike frame you'd want to quench the casting to harden the metal as much as you can, which would help, but it would still be weak. I am not certain that quenching works on gold. I suspect the main issue would be the dropouts, and you'd need to use long, fat axles - like the 14mm thick axles used on some load bikes - to spread the load and stop the axle just cutting straight through the frame when the rider sat on the bike. Likewise, big, low-pressure tyres to reduce peak forces on the frame.
As you make the "tubes" (probably solid, for practicality of construction) fatter you'll start to run into scaling problems. Beam strength scales as the square, but mass as the cube. At some point my initial claim that "rider mass is dominant" will stop being true. It might be easier to fabricate the frame as a one-piece casting using I-beams rather than tubes, so that it can be cast and quenched quickly. There doesn't seem to be a lot of research in this area, probably as there's no practical use for "the strongest pure gold beam" but the experiments are expensive (and toxic).
The reason that gold plating and alloys are used is that even small sculptures have structural issues when made of 24 carat gold. The largest pure gold statue I can find online is only 10cm tall and that's labelled as fragile (but that search is fraught as there is so much "huge ... 24 carat gold... plated").
Edit NHinkle suggested in chat that if you float the bike in mercury the structural issues are greatly reduced, so a (solid) gold frame would be ridable, at least for someone willing to immerse themselves in mercury and for the brief time before the gold dissolved in the mercury. The general principle holds though, so "yes, you can make a ridable bike frame out of pure gold". The question is, what would you have to immerse the bike and rider in to balance the weak structure with the load? Water might work, but you'd probably need a denser fluid. Nearly saturated metal salts in water, for example, might work. Or simply doing the build and ride somewhere that gravity is not as strong. The moon, for example, or Ceres.