How can I create a subdivided cube with the texture shown on the example:
An option to achieve this look would be to use a musgrave texture as the factor of two diffuse shaders. For this example, a quick search for 'grid image' gave me an image to use for slight displacement, and to keep things simple as the wireframe node will give triangles, and freestyle didn't look too good either.
This is the image used for the grid:
The node setup is as follows, note that the musgrave is connected to the object output of the texture coordinate node, and the mapping node to the UV output as the cube is uv unwrapped.
Play with the scale on the musgrave texture to get a look that you like, likewise with your grid texture in the mapping node.
This should give you a starting point, hope it helps. Finished result: