How can I easily identify if a substance is an acid or base based on its chemical formula?
I was going to mark this as too broad, but it's not too broad, because the answer is quite simple: in general, you cannot determine the acid or base properties of a substance from its formula.

As a concrete example, consider the formula $\ce{C4H7NO3}$.

Here are two possible isomers for that formula:


The left compound is an acid. The right compound is a base.