Cut a 12-inch square out of 3/4-inch plywood with a saw.
Cut the square diagonally, creating two triangles.
Stack the triangles on top of each other and clamp them together.
Measure down 3/4 of an inch from one of the 12-inch sides and draw a line parallel to that edge.
Draw a small "X" every inch along that line.
Drill a 1/2-inch hole at each "X," boring through both triangles. This will position the holes at the exact same place on each triangle, which will be the top edge.
Unclamp the triangles when the holes have been drilled.
Cut two 4-inch sections of 2-by-2 board.
Attach the 2-by-2 sections along the other 12-inch edge of the triangles, centered along that edge, with two 2-inch wood screws each. They should be positioned on opposite sides of the triangles so that they are on the inside when the triangles are stood up next to each other.
Use a stud finder to determine the distance between your wall studs. Add 2 inches to this measurement.
Cut pieces of 1/2-inch dowel to your measurement in the previous step. You will need one for each pair of holes that you drilled.
Apply wood glue into each pair of triangle holes and thread a dowel through them, extending it 1/4-inch out from each side. Begin with the front and back pairs of holes, then fill in the middle ones.
Wipe off any excess wood glue with a paper towel and allow the glue to dry overnight.
Position the shelf against the wall and drill two 1/8-inch pilot holes through each 2-by-2 section and into the wall stud behind it.
Mount the shelf to the wall with four 3-inch wood screws.