Newbie question: one-way functions in cryptography
So it doesn't look like a one-way function to me.


What you're missing is the scale and basic ideas used in cryptography. Namely the following three facts:


Cryptographic exponents for discrete logarithms have thousands of bits instead of 3 as the example in the question. As such merely trying one value at a time, would take several billion years at least.
In cryptography, you only ever see the result of the exponentiation after the modular reduction (the third row of the graphic), because there are efficient algorithms for finding logarithms over the real numbers.
When using these system in cryptography we don't actually perform $2^{1000}$ or so multiplications but instead use repeated square and multiply which brings this down to a few thousand multiplications. Note that this algorithms requires full knowledge of the exponent to be applied.