My teacher showed us three molecules: a carbohydrate molecule, a protein molecule, and a lauric acid molecule. I noticed that, when an oxygen atom is connected to one carbon atom and isn't connected to any other atom, then the oxygen and carbon atoms are connected with a double bond. Is my hypothesis correct, and has anyone ever found it before?
Over 150 years ago August Kekulé had a dream about how atoms might form molecules. You might find it interesting to read about it.
Chemistry is largely about valence, the number of connections that each atom is able to make with other atoms.
In the cases you are talking about, with co-valent bonds, you can imagine each carbon atom as having 4 arms reaching out, each oxygen having two arms, and each hydrogen having 1 arm.
If an oxygen atom is connected to only one other atom, then that connection must use both arms, holding hands with 2 of the carbon atom's arms (just as you noticed), forming a double bond.
The carbon's other two arms could be connected to another oxygen atom, forming CO2 (carbon dioxide), or to 2 Hydrogen atoms, forming CH2O (formaldehyde). Or it could double bond to another carbon atom, which in turn has two more arms to connect to something else, such as C2H5OH (drinking alcohol).
Molecules based on carbon are so common and potentially so complicated, that there is a whole field (organic chemistry) based on it.
If you are at all interested in chemistry, the concept of valence will be essential to your understanding.