A while ago, I helped some friends move to their new house. They had one of those Target-brand shelves that every college student is familiar with. They cost about $20, and you can find lots of them for free near dorm dumpsters after the school year ends.
The shelf was almost finished, and they decided to throw the shelf out rather than try to move it, and they gave me the three shelves to use for scrap wood. Recently, I found a couple of uses for them repairing other furniture with the same style of finish.
Our bed started falling apart a little while ago. The foot collapsed when I sat on it, and it just kind of rested on the drawers under the bed. To fix it, I built a 5th leg out of a particleboard shelf and scrap wood.
I removed a section from each end of the shelf; the rough edge is on the carpet, the flat edge is against the bed. The shelf wood is directly under the bed frame, supporting it. The leg is made of the two shelf pieces screwed to a 1×6 plank . The screws that go through the bed fix it to the 1×6 plank. You can see in the picture where the wood of the original frame was splitting, causing the bed to collapse.
This is a Target-brand shelf that we have had for years, the same series as the one the scrap shelves came from. The back of the shelf was originally a cardboard sheet nailed in around the edges, which is the only thing keeping the frame from collapsing. I moved it while I was running an Ethernet cable behind it wire behind it, and, when I moved it back, the cardboard fell off.
Luckily, the scrap shelves are exactly the same size as these, so I just used one of the scrap shelves to reinforce the back. The shelf is much stiffer than the cardboard, so it seems only one is required at the very bottom to provide a moment that will keep the frame from collapsing.