How do I tell if $G$ is a forest in log-space?
Using Reingold's algorithm, you can count the number of connected components in a graph. For example, you can count the number of vertices which have the minimal index in their connected component (assuming some arbitrary ordering of the vertices), that is, the number of vertices $i$ that are not connected to any $j &lt; i$.

Now use the following criterion: A graph contains a cycle iff there is an edge whose removal does not increase the number of connected components.