So I have an inverting op amp (gain = -1) wired up, and it works with a DC signal. I checked the DC signal by measuring the input and output voltages with a multimeter which were 5V and -5V, respectively.
Now I hooked up a function generator to the input signal. The input is now 5V peak-to-peak at 1kHz. The input shows up fine on the oscilloscope, but that is because it is practically connected to the source of the generator. When I measure the output, nothing shows up on the oscilloscope (just a little bit of noise). I tried connecting the output to the virtual ground and then measure the output with the oscilloscope, but that didn't do anything.
The op amp I am using is TL051CP.
How am I not measuring it correctly?
So I guess the problem was my signal was grounded and that messed up the output. I just removed the ground from the circuit, and it is working fine. I don't know why it works when the signal is not grounded.
I believe I was shorting the circuit with the oscilloscope, which caused this to happen.