How to read the device ID of a dataflash memory
The datasheet for the part you listed states that a 24-bit address should be written after the 0x90 code. Then the 2-byte Manufacturer and Device codes can be read. So insert 3 write instructions and it should work.

pc.printf("response from sending 90h: %d\r\n", spi.write(0x90));
pc.printf("response from sending 00h: %d\r\n", spi.write(0x00)); //Address 23..16
pc.printf("response from sending 00h: %d\r\n", spi.write(0x00)); //Address 15..8
pc.printf("response from sending 00h: %d\r\n", spi.write(0x00)); //Address 7..0
pc.printf("response from sending 00h: %d\r\n", spi.write(0x00)); //Manufacturer ID
pc.printf("response from sending 00h: %d\r\n", spi.write(0x00)); //Device ID


If you get inconsistent results, you may want to do your writes in a loop, then print when finished. I'm not sure how the printf IO affects the mbed SPI implementation timing, but if you get gaps between byte writes, that may affect how the flash part responds.

unsigned char command[6] = {0x90, 0x00, 0x00, 0x00, 0x00, 0x00};
unsigned char response[6];

for(int i=0; i&lt;6; i++)
{
    response[i] = spi.write(command[i]);
}

pc.printf("Manufacturer ID: %d\r\n", command[4]);
pc.printf("Device ID: %d:\r\n", command[5]);


You also have instruction 90h in your source, but your diagram is for instruction 9Fh. Just changing the instruction may allow your original code to work.